Skip to content

Commit 06b830f

Browse files
committed
Make location of authorized_keys file configurable
1 parent bf466f3 commit 06b830f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Role to manage users on a system.
1515
specified for the user.
1616
* users_create_homedirs (default: true) - create home directories for new
1717
users. Set this to false if you manage home directories separately.
18+
* authorized_keys_file (default: .ssh/authorized_keys) - Set this if the
19+
ssh server is configured to use a non standard authorized keys file.
1820

1921
## Creating users
2022

defaults/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ users_deleted: []
2020
# - name: developers
2121
# gid: 10000
2222
groups_to_create: []
23+
24+
authorized_keys_file: ".ssh/authorized_keys"

tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
authorized_key:
3434
user: "{{item.0.username}}"
3535
key: "{{item.1}}"
36-
path: "{{ item.0.home | default('/home/' + item.0.username) }}/.ssh/authorized_keys"
36+
path: "{{ item.0.home | default('/home/' + item.0.username) }}/{{ authorized_keys_file }}"
3737
with_subelements:
3838
- "{{users}}"
3939
- ssh_key

0 commit comments

Comments
 (0)