Skip to content

Commit e18674f

Browse files
authored
Merge pull request #24 from nkakouros-forks/authorized-path
Adds option to set authorized keys path
2 parents 05a3417 + 830214a commit e18674f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ None
4646
* `ssh_keys_authorized_keys`: [default: `[]`]: Authorized key declarations
4747
* `ssh_keys_authorized_keys.{n}.owner`: [required]: The name of the user that should own the file
4848
* `ssh_keys_authorized_keys.{n}.src`: [required]: The local path of the key
49-
* `ssh_keys_authorized_keys.{n}.state`: [default: `present`]: State
49+
* `ssh_keys_authorized_keys.{n}.state`: [optional, default: `present`]: State
50+
* `ssh_keys_authorized_keys.{n}.path`: [optional, default: `authorized_keys`]: Authorized keys file (relative to `home/.ssh/`)
5051

5152
* `ssh_keys_known_hosts`: [default: `[]`]: Known hosts declarations
5253
* `ssh_keys_known_hosts.{n}.hostname`: [required]: The hostname

tasks/authorized-keys.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
user: "{{ item.owner }}"
66
key: "{{ lookup('file', item.src) }}"
77
state: "{{ item.state | default('present') }}"
8+
path: "~/.ssh/{{ item.path | default('authorized_keys') }}"
89
with_items: "{{ ssh_keys_authorized_keys }}"
910
tags:
1011
ssh-keys-authorized-keys-setup

0 commit comments

Comments
 (0)