Merge pull request #3207 from mirwan/fix_3206

Fix target hosts generation when /etc/hosts does not contain 127.0.0.1 or ::1
This commit is contained in:
k8s-ci-robot 2018-08-31 17:50:56 -07:00 committed by GitHub
commit 13dda0e36e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,7 @@
- name: Hosts | Update target hosts file entries dict with required entries - name: Hosts | Update target hosts file entries dict with required entries
set_fact: set_fact:
etc_hosts_localhosts_dict_target: >- 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}) }} {{ etc_hosts_localhosts_dict_target|default({}) | combine({item.key: (target_entries + item.value.expected)|unique}) }}
with_dict: "{{ etc_hosts_localhost_entries }}" with_dict: "{{ etc_hosts_localhost_entries }}"