Skip to content

Commit

Permalink
Move ssh-keyscan to zuul pre playbook
Browse files Browse the repository at this point in the history
As we now need to connect to each host from the controller we need to
ensure from the very beggining that we are able to SSH each node since
start.
  • Loading branch information
pablintino committed Oct 10, 2023
1 parent e200533 commit 90eb2bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
13 changes: 13 additions & 0 deletions ci/playbooks/multinode-customizations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@
- make
state: present

- name: Ensure we know compute host keys
ansible.builtin.shell:
cmd: |
ssh-keyscan {{ hostvars[item].ansible_host }} >> ~/.ssh/known_hosts
loop: >-
{{
hostvars | dict2items |
selectattr("value.ansible_host", "defined") |
map(attribute="key")
}}
loop_control:
label: "{{ item }}"

- name: Generate an ssh keypair
ansible.builtin.command:
cmd: ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -P ''
Expand Down
18 changes: 0 additions & 18 deletions ci_framework/hooks/playbooks/fetch_compute_facts.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
---
- name: Gather ssh host keys hook
hosts: localhost
gather_facts: false
connection: local
tasks:
- name: Ensure we know compute host keys
ansible.builtin.shell:
cmd: |
ssh-keyscan {{ hostvars[item].ansible_host }} >> ~/.ssh/known_hosts
loop: >-
{{
hostvars | dict2items |
selectattr("value.ansible_host", "defined") |
map(attribute="key")
}}
loop_control:
label: "{{ item }}"

- name: Push repositories hook
hosts: all,!crcs,!crc
gather_facts: true
Expand Down

0 comments on commit 90eb2bd

Please sign in to comment.