Created
August 26, 2009 20:16
-
-
Save tmoertel/175795 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The Puppet definition below produces following error when called as | |
# set_up_service_with_ssh_key("X"): | |
# | |
# err: Could not create ssh key Y for X: user X doesn't exist | |
# | |
# But the ssh_authorized_key resource requires User["X"]. | |
# Am I missing something? | |
define set_up_service_with_ssh_key($service_name) { | |
user { | |
$service_name: | |
ensure => present, | |
provider => useradd, | |
home => "/home/$service_name", | |
managehome => true, | |
name => $service_name, | |
} | |
ssh_authorized_key { | |
"ssh key Y for $service_name": | |
require => User[$service_name], | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment