Remove redundant ssh known hosts prep

This removes redundant ssh known hosts prep in the
multi-node-known-hosts role as we've seen these tasks take significant
amounts of time due to the high cost of ansible looping. According to
the change [0] that added the system wide known_hosts setting this was
not originally done to avoid breaking testing in openstack-zuul-jobs.
Since then those tests have been moved to zuul-jobs [1] and I've updated
them with this change.

This should cut the time to run this role by about half.

[0] https://review.opendev.org/c/zuul/zuul-jobs/+/548642
[1] https://review.opendev.org/c/zuul/zuul-jobs/+/668767

Change-Id: I90492bbb5ae15fd3b36a54071c4eef891f53b405
This commit is contained in:
Clark Boylan 2022-09-12 12:55:24 -07:00
parent 3c6ec6ec27
commit fa1331e4a7
2 changed files with 1 additions and 9 deletions

View File

@ -2,14 +2,6 @@
generate_all_known_hosts: generate_all_known_hosts:
hostvars: "{{ hostvars }}" 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 - name: add default known_host record for every user
become: true become: true
known_hosts: known_hosts:

View File

@ -4,7 +4,7 @@
- multi-node-known-hosts - multi-node-known-hosts
post_tasks: post_tasks:
- name: lookup known_hosts file - name: lookup known_hosts file
command: cat ~/.ssh/known_hosts command: cat /etc/ssh/ssh_known_hosts
register: known_hosts register: known_hosts
- name: Set up host addresses - name: Set up host addresses