9062289151
Change-Id: I191265df7709a6262b44a428d78fe28ffaeb4b75
22 lines
656 B
YAML
22 lines
656 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: "{{ zj_known_host.name }}"
|
|
key: "{{ zj_known_host.key }}"
|
|
with_items: "{{ ansible_facts.all_known_hosts }}"
|
|
loop_control:
|
|
loop_var: zj_known_host
|
|
|
|
- name: add default known_host record for every user
|
|
become: true
|
|
known_hosts:
|
|
name: "{{ zj_known_host.name }}"
|
|
key: "{{ zj_known_host.key }}"
|
|
path: /etc/ssh/ssh_known_hosts
|
|
with_items: "{{ ansible_facts.all_known_hosts }}"
|
|
loop_control:
|
|
loop_var: zj_known_host
|