Fix target hosts generation when /etc/hosts does not contain 127.0.0.1 or ::1

pull/3207/head
Erwan Miran 2018-08-31 16:33:18 +02:00
parent fb7b3305dc
commit 059cd17b47
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,7 @@
- name: Hosts | Update target hosts file entries dict with required entries
set_fact:
etc_hosts_localhosts_dict_target: >-
{%- set target_entries = etc_hosts_localhosts_dict.get(item.key, []) | difference(item.value.get('unexpected' ,[])) -%}
{%- 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 }}"