Skip to content

Commit

Permalink
Fix the condition for the "Create Dnsmasq configuration" task loop.
Browse files Browse the repository at this point in the history
Reverted condition format in 'Create Dnsmasq configuration' task. Previous commit 6f4fe12 (for dnsmasq.yml file) broke the condition. Now it's returned to Jinja2 format.

Fixed:
failed: [10.172.0.20] (item={'dest': '/usr/local/etc/dnsmasq.d/consul.conf', 'group': 'wheel', 'when': 'ansible_os_family|lower == "freebsd"'}) => {"ansible_loop_var": "dnsmasq_item", "changed": false, "checksum": "7572d33da943ed4968d9b6acf5fcc8a93430894d", "dnsmasq_item": {"dest": "/usr/local/etc/dnsmasq.d/consul.conf", "group": "wheel", "when": "ansible_os_family|lower == \"freebsd\""}, "msg": "Destination directory /usr/local/etc/dnsmasq.d does not exist"}
  • Loading branch information
vitabaks committed Jun 23, 2023
1 parent ca5a5fe commit 0449e67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions roles/consul/tasks/dnsmasq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
mode: "0644"
become: true
notify: restart dnsmasq
when: dnsmasq_item.when
tags: dnsmasq
when: "{{ dnsmasq_item.when }}" # noqa no-jinja-when
loop:
- { dest: '/etc/dnsmasq.d/10-consul', group: 'root', when: ansible_os_family|lower != "freebsd" }
- { dest: '/usr/local/etc/dnsmasq.d/consul.conf', group: 'wheel', when: ansible_os_family|lower == "freebsd" }
loop_control:
loop_var: dnsmasq_item
tags: dnsmasq

- name: Disable systemd-resolved
when: ansible_service_mgr == "systemd"
Expand Down

0 comments on commit 0449e67

Please sign in to comment.