bootstrap: Ensure user has .ssh/authorized_keys before trying to copy

dehydrated
Felix Stupp 4 years ago
parent 096554f37b
commit f610812fc7
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -25,6 +25,20 @@
name: "{{ bootstrap_user }}"
state: present
register: bootstrap_user_data
- name: Be sure old user has .ssh directory
file:
state: directory
path: "{{ bootstrap_user_data.home }}/.ssh"
owner: "{{ bootstrap_user }}"
group: "{{ bootstrap_user }}"
mode: "u=rwx,g=rx,o="
- name: Be sure old user has authorized_keys file
file:
state: touch
path: "{{ bootstrap_user_data.home }}/.ssh/authorized_keys"
owner: "{{ bootstrap_user }}"
group: "{{ bootstrap_user }}"
mode: "u=rw,g=r,o="
- name: Create .ssh directory for user {{ bootstrap_expected_user }}
file:
path: "{{ bootstrap_expected_user_data.home }}/.ssh"

Loading…
Cancel
Save