Refactor block
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Danny Bessems 2022-04-20 08:35:27 +02:00
parent 51302033aa
commit a52d8014d1

View File

@ -66,22 +66,19 @@
groups: k3s_ha
with_items: "{{ nodes }}"
- name: Add new VM's as 'known_hosts'
block:
- name: Scan public key
- name: Scan public keys
ansible.builtin.command:
cmd: "ssh-keyscan -t rsa {{ item.ip }}"
register: publickey
register: publickeys
with_items: "{{ nodes }}"
- name: Store public key
- name: Store public keys
ansible.builtin.known_hosts:
name: "{{ item.name }}"
key: "{{ publickey.stdout }}"
name: "{{ item.item }}"
key: "{{ item.stdout }}"
state: present
path: ~/.ssh/known_hosts
with_items: "{{ nodes }}"
with_items: "{{ publickeys.results }}"
- name: Provision Kubernetes
hosts: k3s_ha