18 lines
532 B
YAML
18 lines
532 B
YAML
- 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 for ansible_user
|
|
known_hosts:
|
|
name: "{{ item.name }}"
|
|
key: "{{ item.key }}"
|
|
with_items: "{{ ansible_facts.all_known_hosts }}"
|
|
|
|
- name: add default known_host record for every user
|
|
become: true
|
|
known_hosts:
|
|
name: "{{ item.name }}"
|
|
key: "{{ item.key }}"
|
|
path: /etc/ssh/ssh_known_hosts
|
|
with_items: "{{ ansible_facts.all_known_hosts }}"
|