Skip to content

Instantly share code, notes, and snippets.

@tmoertel
Created August 26, 2009 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmoertel/175795 to your computer and use it in GitHub Desktop.
Save tmoertel/175795 to your computer and use it in GitHub Desktop.
# 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