Last time I ended up not being able to create my user because I didn't have a group for it and ran out of time before I needed to call it a night. So I'll start tonight by creating a group for my user. Go to the puppet config dir:
# cd /etc/puppet
Then edit the virtual file we created in our users module last time and add a group, like this:
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", } }
Next in the unixadmins file we need to realize our new group, it should look like this:
users/manifests/virtual.pp
class user::unixadmins inherits user::virtual { realize( Group["andrewmccall"], User["andrewmccall"] ) }
Run puppet on the local files and you'll have a new user and a group for it. It should look something like this:
# 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
Don't forget to commit the changes to the git repo.
# git add . # git commit -a -m "Added a users module to manage users"