Merge "Fix bootstrap-host authorized_key transfer for multi-nodes"

This commit is contained in:
Jenkins 2016-09-19 14:45:06 +00:00 committed by Gerrit Code Review
commit 3591db8ba4

View File

@ -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