account: Configure authorized_keys using authorized_key module

- also restricts .ssh directory only to user
- restriction was automatically applied by authorized_keys module before
- more restriction is not harmful
- this restriction ensures indempotency while using the authorized_keys module
master
Felix Stupp 4 years ago
parent 0a8ee3983d
commit c8fdc4fae9
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -52,23 +52,11 @@
group: "{{ username }}"
mode: "u=rwx,g=rx,o="
- name: Configure ssh configration directory
file:
path: "{{ user_directory }}/.ssh"
state: directory
owner: "{{ username }}"
group: "{{ username }}"
mode: "u=rwx,g=rx,o="
- name: Configure authorized_keys
get_url:
url: "{{ authorized_keys }}"
dest: "{{ user_directory }}/.ssh/authorized_keys"
force: yes
owner: "{{ username }}"
group: "{{ username }}"
mode: "u=rwx,g=rx,o="
ignore_errors: yes
authorized_key:
state: present
user: "{{ username }}"
key: "{{ authorized_keys }}"
- name: Configure zsh
become_user: "{{ username }}"

Loading…
Cancel
Save