Douglas Brancaglion
2012-Aug-21 18:56 UTC
[Puppet Users] Using Virtual Resource in custom resource type
Hi!
I am facing difficulties in using the virtual resource types in resorce
custom, I have a definition of user creation as shown below:
define add_user ( $email, $uid, $key, $groups ) {
$username = $title
user { $username:
comment => "$email",
groups => $groups,
managehome => true,
home => "/home/$username",
shell => "/bin/bash",
uid => $uid
}
file { "/home/$username/":
ensure => directory,
owner => $username,
group => $username,
mode => 700,
require => [ user[$username] ]
}
file { "/home/$username/.ssh":
ensure => directory,
owner => $username,
group => $username,
mode => 700,
require => file["/home/$username/"]
}
# now make sure that the ssh key authorized files is around
file { "/home/$username/.ssh/authorized_keys":
ensure => present,
owner => $username,
group => $username,
mode => 600,
require => file["/home/$username/"]
}
ssh_authorized_key{ "${username}":
ensure => present,
type => "ssh-rsa",
user => $username,
key => $key,
}
}
And in my users manifests I declare this way:
@add_user { test:
email => "user test",
uid => 1040,
groups => apache,
key =>
"AAAAB3NzaC1yc2EAAAADAQfTRr6mUam1rIiwWhseaRP9M83L2NXFBMix4d7q1xkO/bMqCvvRPjzVzQNGhEJFn8Pjz2pr+QcK2c2yqceSTpbVoxM8Gg5/dXwKv+ct4qKjLVtSty8s/VW8g+kI3N5R9Xv1SG7exJdutKfEnoCGY4lXjrU11fvCZq5Zrc5",
}
and in my node i declare this way:
import "custom_resource"
import "users_manifests"
node "server01.domain" {
--
Douglas Brancaglion
Security Analist
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2012-Aug-27 18:38 UTC
[Puppet Users] Re: Using Virtual Resource in custom resource type
On Tuesday, August 21, 2012 1:56:46 PM UTC-5, Douglas Brancaglion wrote:> > Hi! > > I am facing difficulties in using the virtual resource types in resorce > custom [...] >What exactly is the nature of the problem? It looks like maybe your post was truncated. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/9EF-cD7eU80J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.