mirror of
https://github.com/luzifer-ansible/users.git
synced 2024-12-22 18:01:18 +00:00
Fix: When managing root user, use right dir
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
00916c979c
commit
7fee72eb09
1 changed files with 3 additions and 3 deletions
|
@ -12,7 +12,7 @@
|
|||
|
||||
- name: Ensure .ssh directory
|
||||
file:
|
||||
dest: '/home/{{ item.name }}/.ssh'
|
||||
dest: '{% if item.name != "root" %}/home{% endif %}/{{ item.name }}/.ssh'
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: '{{ item.name }}'
|
||||
|
@ -22,7 +22,7 @@
|
|||
- name: Install SSH keys for users
|
||||
copy:
|
||||
content: '{{ item.ssh_key }}'
|
||||
dest: '/home/{{ item.name }}/.ssh/authorized_keys'
|
||||
dest: '{% if item.name != "root" %}/home{% endif %}/{{ item.name }}/.ssh/authorized_keys'
|
||||
mode: 0600
|
||||
owner: '{{ item.name }}'
|
||||
group: '{{ item.name }}'
|
||||
|
@ -32,7 +32,7 @@
|
|||
- name: Install Github SSH keys for user
|
||||
get_url:
|
||||
url: 'https://github.com/{{ item.github_key_user }}.keys'
|
||||
dest: '/home/{{ item.name }}/.ssh/authorized_keys'
|
||||
dest: '{% if item.name != "root" %}/home{% endif %}/{{ item.name }}/.ssh/authorized_keys'
|
||||
force: yes
|
||||
mode: 0600
|
||||
owner: '{{ item.name }}'
|
||||
|
|
Loading…
Reference in a new issue