Refactor to idempotent methods
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
5e83766370
commit
51302033aa
16
playbook.yml
16
playbook.yml
@ -66,9 +66,21 @@
|
||||
groups: k3s_ha
|
||||
with_items: "{{ nodes }}"
|
||||
|
||||
- name: Store public keys in 'known_hosts'
|
||||
- name: Add new VM's as 'known_hosts'
|
||||
block:
|
||||
|
||||
- name: Scan public key
|
||||
ansible.builtin.command:
|
||||
cmd: ssh-keyscan -t rsa {{ item.ip }} >> ~/.ssh/known_hosts
|
||||
cmd: "ssh-keyscan -t rsa {{ item.ip }}"
|
||||
register: publickey
|
||||
|
||||
- name: Store public key
|
||||
ansible.builtin.known_hosts:
|
||||
name: "{{ item.name }}"
|
||||
key: "{{ publickey.stdout }}"
|
||||
state: present
|
||||
path: ~/.ssh/known_hosts
|
||||
|
||||
with_items: "{{ nodes }}"
|
||||
|
||||
- name: Provision Kubernetes
|
||||
|
Loading…
Reference in New Issue
Block a user