Skip to content

Commit 1c2b392

Browse files
author
Clayton O'Neill
committed
Specify SSH key target to fix idempotency issue
If the target isn't specified, then sshkeys::set_authorized_key depends on the homedir fact. Since the user doesn't exist on the first run, this fact won't exist and the first puppet run will fail. Since we have the home directory hard coded in the user creation anyway, go ahead and provide that target to the sshkeys class to avoid the idempotency issue.
1 parent bf21b6f commit 1c2b392

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

manifests/client/user.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
sshkeys::set_authorized_key { "${server_user_exploded} to ${client_user}":
4343
local_user => $client_user,
4444
remote_user => $server_user_exploded,
45+
target => "/home/${client_user}/.ssh/authorized_keys",
4546
require => User[$client_user],
4647
options => [
4748
"command=\"${allowed_command}\"",

0 commit comments

Comments
 (0)