feat: use label in loop_control
This commit is contained in:
parent
1dc9ed9418
commit
5bdf234863
2 changed files with 11 additions and 0 deletions
|
@ -8,6 +8,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- test: replace kitchen to molecule
|
- test: replace kitchen to molecule
|
||||||
|
- feat: use label in loop_control
|
||||||
|
|
||||||
## v1.3.0 (2020-02-12)
|
## v1.3.0 (2020-02-12)
|
||||||
- feat: add support debian 10
|
- feat: add support debian 10
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
bind_zones_play: '{{ bind_zones_play|default([]) + [ item ] }}'
|
bind_zones_play: '{{ bind_zones_play|default([]) + [ item ] }}'
|
||||||
loop: '{{ bind_zones|dict2items }}'
|
loop: '{{ bind_zones|dict2items }}'
|
||||||
|
loop_control:
|
||||||
|
label: '{{ item.key }}'
|
||||||
when: >
|
when: >
|
||||||
(item.value.state is not defined or item.value.state != 'absent')
|
(item.value.state is not defined or item.value.state != 'absent')
|
||||||
and (bind_zones_subset is not defined or item.key in bind_zones_subset)
|
and (bind_zones_subset is not defined or item.key in bind_zones_subset)
|
||||||
|
@ -14,6 +16,8 @@
|
||||||
group: bind
|
group: bind
|
||||||
mode: 0755
|
mode: 0755
|
||||||
state: directory
|
state: directory
|
||||||
|
loop_control:
|
||||||
|
label: '{{ item.key }}'
|
||||||
loop: '{{ bind_zones_play }}'
|
loop: '{{ bind_zones_play }}'
|
||||||
|
|
||||||
- name: copy zone files
|
- name: copy zone files
|
||||||
|
@ -24,6 +28,8 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
loop: '{{ bind_zones_play }}'
|
loop: '{{ bind_zones_play }}'
|
||||||
|
loop_control:
|
||||||
|
label: '{{ item.key }}'
|
||||||
register: zone
|
register: zone
|
||||||
notify: reload bind
|
notify: reload bind
|
||||||
|
|
||||||
|
@ -34,6 +40,8 @@
|
||||||
args:
|
args:
|
||||||
chdir: /etc/bind/keys
|
chdir: /etc/bind/keys
|
||||||
loop: '{{ zone.results }}'
|
loop: '{{ zone.results }}'
|
||||||
|
loop_control:
|
||||||
|
label: '{{ item.item.key }}'
|
||||||
when: item.item.key in bind_dnssec and item.changed
|
when: item.item.key in bind_dnssec and item.changed
|
||||||
notify: reload bind
|
notify: reload bind
|
||||||
|
|
||||||
|
@ -49,6 +57,8 @@
|
||||||
path: '{{ item.path }}'
|
path: '{{ item.path }}'
|
||||||
state: absent
|
state: absent
|
||||||
loop: '{{ zone_folders.files }}'
|
loop: '{{ zone_folders.files }}'
|
||||||
|
loop_control:
|
||||||
|
label: '{{ item.path|basename }}'
|
||||||
when: >
|
when: >
|
||||||
item.path|basename not in bind_zones or
|
item.path|basename not in bind_zones or
|
||||||
('state' in bind_zones[item.path|basename] and bind_zones[item.path|basename].state == 'absent')
|
('state' in bind_zones[item.path|basename] and bind_zones[item.path|basename].state == 'absent')
|
||||||
|
|
Loading…
Reference in a new issue