Skip to content

Commit 5761570

Browse files
authored
Merge pull request #27 from zeridon/fix-key_path-expansion
Fix path expansion for authorized_keys
2 parents 755a601 + a198e76 commit 5761570

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ None
5050
* `ssh_keys_authorized_keys.{n}.owner`: [required]: The name of the user that should own the file
5151
* `ssh_keys_authorized_keys.{n}.src`: [required]: The local path of the key
5252
* `ssh_keys_authorized_keys.{n}.state`: [optional, default: `present`]: State
53-
* `ssh_keys_authorized_keys.{n}.path`: [optional, default: `authorized_keys`]: Authorized keys file (relative to `home/.ssh/`)
53+
* `ssh_keys_authorized_keys.{n}.path`: [optional, default: `authorized_keys`]: Authorized keys file (absolute path, default to `~/.ssh/authorized_keys`)
5454

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

tasks/authorized-keys.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +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') }}"
8+
path: "{{ item.path | default('~' + item.owner + '/.ssh/authorized_keys') }}"
99
with_items: "{{ ssh_keys_authorized_keys }}"
1010
tags:
1111
ssh-keys-authorized-keys-setup

0 commit comments

Comments
 (0)