Multi-node: Streamline multi-node-known-hosts

We're now evaluating the condition whether or not to run this role
at the playbook level instead since there are different roles using
this same condition.

Change-Id: I99738c7e98133838f989ed369a09ecb6a7b64054
This commit is contained in:
David Moreau-Simard 2017-09-16 17:09:03 -06:00
parent 645a3935ee
commit e748a8a56b
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
2 changed files with 9 additions and 13 deletions

View File

@ -1,3 +1,9 @@
- name: Setup known_hosts for cross-node SSH'ing when we have more than 1 host
include: setup-multinode-known-hosts.yaml
when: hostvars|length > 1
- name: Get known_hosts facts
generate_all_known_hosts:
hostvars: "{{ hostvars }}"
- name: add known_host record for every public key of every other ip, hostname
known_hosts:
name: "{{ item.name }}"
key: "{{ item.key }}"
with_items: "{{ all_known_hosts }}"

View File

@ -1,10 +0,0 @@
- name: Get known_hosts facts
generate_all_known_hosts:
hostvars: "{{ hostvars }}"
- name: add known_host record for every public key of every other ip, hostname
known_hosts:
name: "{{ item.name }}"
key: "{{ item.key }}"
with_items:
"{{ all_known_hosts }}"