On 8/29/2012 8:31 AM, Tony Caffe wrote:
Hi,
I am trying to get puppet going on CentOS 6.3 and I got it installed and
running. I want to create good manifests for basic stuff. I know I will learn
more as I go but I am new to programming in general and puppet code. I have
puppet master install on 1 cloud server and a client test puppet on another
cloud server. I was able to run this code correctly. Now I want to make it
better.
Here is what I have so far for my Push to add users to my nodes.
site.pp: (I know its short lol)
node 'puppet-client' {
import "classes/adduser.pp"
}
adduser.pp located in /etc/puppet/manifests/classes/
define custom_user($passwd) {
user { "${name}":
ensure => present,
password => $passwd,
shell => "/bin/bash",
managehome => true,
}
}
custom_user {
"anthony":
passwd => 'Removed real hash here',
}
custom_user {
"admin":
passwd => 'Hash for password gone',
}
custom_user {
"luca":
passwd => 'My Password Hash Here',
}
So I am testing on a test-only server till I get the hang of it. So I have many
cloud servers and need to be able to add my admin users. I need help now to
modify /etc/sudoers or visudo and add these people to the doc with ALL=(ALL)
ALL
Please help me. I know I need to add a template and also a module of my own. I
mainly need help with code and learning to build off this for future system
changes. Please help me keep this simple and dumb-down lol. FYI - After this I
want to start on Apache and editing the config and setting up new servers from
an image. This is more practical and important to start with.
Your sudo should be new enough to support /etc/sudoers.d/ which means
you can just drop a file per user into that dir. Make Puppet manage the
whole dir and purge anything it doesn't recognize and you're all set.
Ramin
--
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+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.