Fix bootstrap-host authorized_key transfer for multi-nodes
This ensures the lookup has something to lookup and doesn't assume that the operation will run as in the root folder by default. This assumption was fine for an AIO, but the process has to be done differently for multi nodes. Change-Id: Ia4121ebe8b4d64fd81ce779330d659bb954e4079 Signed-off-by: Jean-Philippe Evrard <jean-philippe@evrard.me>
This commit is contained in:
parent
51f4dec329
commit
f904d75fa8
@ -57,11 +57,19 @@
|
||||
tags:
|
||||
- ssh-key-generate
|
||||
|
||||
- name: Ensure root's new public ssh key is in authorized_keys
|
||||
authorized_key:
|
||||
user: root
|
||||
key: "{{ lookup('file', '/root/.ssh/id_rsa.pub') }}"
|
||||
manage_dir: no
|
||||
- name: Fetch the generated public ssh key
|
||||
fetch:
|
||||
src: "/root/.ssh/id_rsa.pub"
|
||||
dest: "/tmp/id_rsa.pub"
|
||||
flat: yes
|
||||
when: inventory_hostname == groups['all'][0]
|
||||
tags:
|
||||
- ssh-key-authorized
|
||||
|
||||
- name: Ensure root's new public ssh key is in authorized_keys
|
||||
authorized_key:
|
||||
user: root
|
||||
key: "{{ lookup('file','/tmp/id_rsa.pub') }}"
|
||||
manage_dir: no
|
||||
tags:
|
||||
- ssh-key-authorized
|
Loading…
Reference in New Issue
Block a user