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 3 years ago
parent 0a8ee3983d
commit c8fdc4fae9
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -52,23 +52,11 @@
group: "{{ username }}" group: "{{ username }}"
mode: "u=rwx,g=rx,o=" 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 - name: Configure authorized_keys
get_url: authorized_key:
url: "{{ authorized_keys }}" state: present
dest: "{{ user_directory }}/.ssh/authorized_keys" user: "{{ username }}"
force: yes key: "{{ authorized_keys }}"
owner: "{{ username }}"
group: "{{ username }}"
mode: "u=rwx,g=rx,o="
ignore_errors: yes
- name: Configure zsh - name: Configure zsh
become_user: "{{ username }}" become_user: "{{ username }}"

Loading…
Cancel
Save