zuul-jobs/roles/multi-node-known-hosts/tasks/main.yaml
Ian Wienand af3f79121a
linter: Use capitals for names
This is pretty trivial, but consistency is probably better in this
regard and it does guide you to writing a sentence that is human
parsable, which is the point of it.

Change-Id: Iaab9bb6aec0ad0f1d3cae10364c1f1b37d02801e
2022-11-07 10:37:53 +11:00

14 lines
376 B
YAML

- name: Get known_hosts facts
generate_all_known_hosts:
hostvars: "{{ hostvars }}"
- 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