Switch to shell module
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
75d1e95238
commit
29f7ebf14a
27
playbook.yml
27
playbook.yml
@ -66,19 +66,22 @@
|
||||
groups: k3s_ha
|
||||
with_items: "{{ nodes }}"
|
||||
|
||||
# - name: Scan public keys
|
||||
# ansible.builtin.shell:
|
||||
# cmd: "ssh-keyscan -t rsa {{ item.ip }}"
|
||||
# register: publickeys
|
||||
# with_items: "{{ nodes }}"
|
||||
- name: Scan public keys
|
||||
ansible.builtin.shell:
|
||||
cmd: "ssh-keyscan -t rsa {{ item.ip }}"
|
||||
register: publickeys
|
||||
with_items: "{{ nodes }}"
|
||||
|
||||
# - name: Store public keys
|
||||
# ansible.builtin.known_hosts:
|
||||
# name: "{{ item.item }}"
|
||||
# key: "{{ item.stdout }}"
|
||||
# state: present
|
||||
# path: ~/.ssh/known_hosts
|
||||
# with_items: "{{ publickeys.results }}"
|
||||
- ansible.builtin.debug:
|
||||
var: publickeys
|
||||
|
||||
- name: Store public keys
|
||||
ansible.builtin.known_hosts:
|
||||
name: "{{ item.item }}"
|
||||
key: "{{ item.stdout }}"
|
||||
state: present
|
||||
path: ~/.ssh/known_hosts
|
||||
with_items: "{{ publickeys.results }}"
|
||||
|
||||
- name: Provision Kubernetes
|
||||
hosts: k3s_ha
|
||||
|
Loading…
Reference in New Issue
Block a user