Scope all_known_hosts in mult-node-known-hosts

Ansible is moving towards ansible_facts return values going in to
ansible_facts rather than the top-level dict. ansible_facts exists
starting in ansible 2.5, so go ahead and start consuming the value that
way.

Change-Id: Iac13b1efb47c9d79ed088e1cf9176003790c74f7
This commit is contained in:
Monty Taylor 2018-07-23 13:20:39 -05:00
parent e3d911b3ef
commit 054812719f
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@
known_hosts:
name: "{{ item.name }}"
key: "{{ item.key }}"
with_items: "{{ all_known_hosts }}"
with_items: "{{ ansible_facts.all_known_hosts }}"
- name: add default known_host record for every user
become: true
@ -14,4 +14,4 @@
name: "{{ item.name }}"
key: "{{ item.key }}"
path: /etc/ssh/ssh_known_hosts
with_items: "{{ all_known_hosts }}"
with_items: "{{ ansible_facts.all_known_hosts }}"