A few useful Puppet snippets

I’ve been playing with Puppet lately both on my home network and within the Fedora’s Infrastructure team and I thought some of the work I did might be useful for anyone out there being stuck with a Puppet’s manifest or an ERB template.

Snippet #1: Make sure the user ‘foo’ is alwais created with its own home directory, password, shell, and full name.

Snippet #2: Make sure the user ‘foo’ gets added into /etc/sudoers.

Snippet #3: Make sure that openssh-server is: installed, running on Port 222 and accepting RSA authentications only.

Snippet #4: Don’t apply a specific IPTABLES rule if an host is tagged as ‘staging’ in the relevant node file.

On templates/iptables.erb:

On the manifest file:

That’s all for now!

Share on Google+8Tweet about this on TwitterShare on Facebook0Share on LinkedIn0Digg thisShare on Reddit0Share on StumbleUpon0Email this to someone