What's wrong with "with_nested"?
#####
- name: Update ifcfg-* files
ini_file:
path: "{{ net_path }}{{ item[1] }}"
no_extra_spaces: true
section: null
state: present
option: "{{ item[0].option }}"
value: "{{ item[0].value }}"
with_nested:
- [{ option: "NM_CONTROLLED", value: "no" }, { option: "PEERDNS", value: "no" }, { option: "DNS1", value: "{{ dns1
}}" }, { option: "DNS2", value: "{{ dns2 }}" }]
- '{{ ifcfg_list.stdout_lines }}'
notify:
- Networking
#####
Am 29.01.2018 um 19:07 schrieb John Harmon:
> |
> -name:Gatherlist of ifcfg-*files
> shell:ls "{{ net_path }}"|grep ^ifcfg-|grep 0$ |grep -ve ifcfg-lo -e \@# \@ excludes ansible backup files