@@ -0,0 +1,10 @@ | |||||
--- | |||||
- name: write ssh_known_hosts file | |||||
local_action: known_hosts | |||||
args: | |||||
path: "{{ playbook_dir }}/ssh_known_hosts" | |||||
name: "{{ item }}" | |||||
key: "{{ item }},{{ hostvars[item].ssh_ip }} ssh-ed25519 {{ hostvars[item].ssh_host_key_ed25519_public }}" | |||||
with_items: "{{play_hosts}}" | |||||
run_once: true |
@@ -21,6 +21,13 @@ | |||||
or not ssh_host_key_state == 'configured' | or not ssh_host_key_state == 'configured' | ||||
- include: save.yml | - include: save.yml | ||||
when: | |||||
ssh_host_key_state == 'configured' or | |||||
ssh_host_key_state == 'scanned' or | |||||
ssh_host_key_state == 'regenerated' or | |||||
ssh_host_key_state == 'fetched' | |||||
- include: file.yml | |||||
when: | when: | ||||
ssh_host_key_state == 'configured' or | ssh_host_key_state == 'configured' or | ||||
ssh_host_key_state == 'scanned' or | ssh_host_key_state == 'scanned' or | ||||
@@ -5,12 +5,3 @@ | |||||
- name: host_vars file | - name: host_vars file | ||||
local_action: template src=host_vars.j2 dest=host_vars/{{inventory_hostname}}/ssh_host_key.yml | local_action: template src=host_vars.j2 dest=host_vars/{{inventory_hostname}}/ssh_host_key.yml | ||||
- name: write ssh_known_hosts file | |||||
local_action: known_hosts | |||||
args: | |||||
path: "{{ playbook_dir }}/ssh_known_hosts" | |||||
name: "{{ item }}" | |||||
key: "{{ item }},{{ hostvars[item].ssh_ip }} ssh-ed25519 {{ hostvars[item].ssh_host_key_ed25519_public }}" | |||||
with_items: "{{play_hosts}}" | |||||
run_once: true |