Skip to content

Commit

Permalink
Reduce output when looping over zones
Browse files Browse the repository at this point in the history
  • Loading branch information
0x46616c6b committed Sep 28, 2024
1 parent 54458da commit be5f563
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@

- name: Create dynamic DNS keys
ansible.builtin.include_tasks: create_ddns_keys.yml
with_items:
loop:
- "{{ bind9_zones_static + bind9_zones_dynamic }}"
loop_control:
label: "{{ item.name }}"
when: bind9_generate_ddns_key | bool

- name: Configure bind9 named.conf files
Expand All @@ -37,7 +39,7 @@
owner: root
group: "{{ bind9_group }}"
mode: "0644"
with_items:
loop:
- named.conf.local
- named.conf.options
notify:
Expand Down Expand Up @@ -79,7 +81,7 @@
owner: root
group: "{{ bind9_group }}"
mode: "0644"
with_items: "{{ bind9_authoritative_includes }}"
loop: "{{ bind9_authoritative_includes }}"
when: bind9_authoritative | default()
notify:
- Zone file change
Expand Down Expand Up @@ -118,8 +120,10 @@
owner: "{{ bind9_user }}"
group: "{{ bind9_group }}"
mode: "0644"
with_items:
loop:
- "{{ bind9_zones_static + bind9_zones_dynamic }}"
loop_control:
label: "{{ item.name }}"
when:
- bind9_authoritative | default()
- item.type | default(bind9_zone_type) == 'master'
Expand All @@ -132,8 +136,10 @@
owner: "{{ bind9_user }}"
group: "{{ bind9_group }}"
mode: "0600"
with_items:
loop:
- "{{ bind9_zones_static + bind9_zones_dynamic }}"
loop_control:
label: "{{ item.name }}"
when:
- bind9_authoritative | default()
- item.type | default(bind9_zone_type) == 'master'
Expand All @@ -145,8 +151,10 @@
paths: "{{ bind9_keydir }}"
patterns: "K{{ item.name }}.+008+*"
register: bind9_reg_dnssec_keys_tmp
with_items:
loop:
- "{{ bind9_zones_dynamic + bind9_zones_static }}"
loop_control:
label: "{{ item.name }}"
when:
- bind9_authoritative | default()
- bind9_dnssec | default() or item.dnssec | default(bind9_dnssec_zones_default_enabled)
Expand Down Expand Up @@ -317,7 +325,9 @@
group: "{{ bind9_group }}"
mode: "0644"
force: "{{ item.force_update | default('yes') }}"
with_items: "{{ bind9_zones_static }}"
loop: "{{ bind9_zones_static }}"
loop_control:
label: "{{ item.name }}"
when:
- bind9_authoritative | default()
- item.type | default(bind9_zone_type) == 'master'
Expand All @@ -332,9 +342,11 @@
register: bind9_reg_named_checkzone
become: true
become_user: "{{ bind9_user }}"
with_items:
loop:
- "{{ bind9_zones_dynamic }}"
- "{{ bind9_zones_static }}"
loop_control:
label: "{{ item.name }}"
when: item.type | default(bind9_zone_type) == 'master'
changed_when: False
vars:
Expand Down

0 comments on commit be5f563

Please sign in to comment.