Replace deprecated 'with_dict' with 'loop' (#7442)

(cherry picked from commit 6479e26904)
This commit is contained in:
Florian Ruynat
2021-04-05 22:45:19 +02:00
committed by Kubernetes Prow Robot
parent 16c750b20a
commit 5cf0de61a3
3 changed files with 10 additions and 17 deletions

View File

@@ -56,7 +56,7 @@
etc_hosts_localhosts_dict_target: >-
{%- set target_entries = (etc_hosts_localhosts_dict|default({})).get(item.key, []) | difference(item.value.get('unexpected' ,[])) -%}
{{ etc_hosts_localhosts_dict_target|default({}) | combine({item.key: (target_entries + item.value.expected)|unique}) }}
with_dict: "{{ etc_hosts_localhost_entries }}"
loop: "{{ etc_hosts_localhost_entries|dict2items }}"
- name: Hosts | Update (if necessary) hosts file
lineinfile:
@@ -66,7 +66,7 @@
state: present
backup: yes
unsafe_writes: yes
with_dict: "{{ etc_hosts_localhosts_dict_target }}"
loop: "{{ etc_hosts_localhosts_dict_target|dict2items }}"
# gather facts to update ansible_fqdn
- name: Update facts