Groups in puppet.
by
# cd /etc/puppet
users/manifests/virtual.pp
class user::virtual {
@user { "andrewmccall":
ensure => "present",
uid => "1001",
gid => "1001",
comment => "Andrew McCall",
home => "/home/andrewmccall",
shell => "/bin/bash",
managehome => true,
require => [Group["andrewmccall"]],
}
@group { "andrewmccall":
ensure => "present",
gid => "1001",
}
}
users/manifests/virtual.pp
class user::unixadmins inherits user::virtual {
realize(
Group["andrewmccall"],
User["andrewmccall"]
)
}
# puppet -v --modulepath=/etc/puppet/modules /etc/puppet/manifests/site.pp
info: Autoloaded module sudo
info: Autoloaded module user
info: Applying configuration version '1281368198'
notice: //user::virtual/Group[andrewmccall]/ensure: created
notice: //user::virtual/User[andrewmccall]/ensure: created
# git add .
# git commit -a -m "Added a users module to manage users"
Subscribe via RSS