Refactor to idempotent methods
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2022-04-20 08:18:13 +02:00
parent 5e83766370
commit 51302033aa

View File

@ -66,9 +66,21 @@
groups: k3s_ha groups: k3s_ha
with_items: "{{ nodes }}" 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: 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 }}" with_items: "{{ nodes }}"
- name: Provision Kubernetes - name: Provision Kubernetes