Puppet Cheat Sheet



Puppet Cheat Sheet

Once you do that, we'll send you the FREE 'Cheat Sheet'. These tips for promoting your art online will be sent once a day for 5 days straight to your inbox. STEP 2: Support the Puppet Podcast (+BONUS). Puppet CHEAT SHEET It is an open source configuration framework which is used when a lot of machines need to be configured in a similar form, or there is an infrastructure that requires dynamic scaling up or down with pre-determined config, or to have control over all the config machines so.

I’m trying to keep a log of my fixes, stuff learned while using puppet.
Many have skipped my mind already. 😦
I’ll try to change publish date on this post every time I edit it so that it stays on top.

How to find config settings or env variables in puppet?

$ puppet --configprint templatedir # Specific Env Variable
templatedir = /var/lib/puppet/templates
$ puppet --configprint all # Specific Env Variable
...

Puppet Cheat Sheet

Stayman

Puppet Code Cheat Sheet

How to syntax check your templates?

$ erb -x -T '-' ../files/apt/sources.list.erb | ruby -c
Syntax OK
$ erb -x -T '-' ../files/apt/sources.list.d/lenny-backports.list.erb | ruby -c
Syntax OK

Unable to sign certificates?
The errors could be:

Puppet Commands Cheatsheet

    a. hostname was not match with the server certificate (or)
    b. Exiting; no certificate found and waitforcert is disabled
    In both cases you will not find the certificate on pupptemaster to sign.

Solution:

1. /etc/hosts file on client should have the server listed in format
IPAddress hostname_of_server short_hostname_of_server puppet
Example: 192.168.1.90 predator01.mydomain.local predator01 puppet
2. Make sure that the domain and search parameters in /etc/resolv.conf of client is same as your host domain
Example: /etc/resolv.conf
domain local
search local
nameserver 8.8.8.8
And my hostname is human01.mydomain.local
If your hostname is like human01.yourdomain.com then 'domain' and 'search' in /etc/resolv.conf should be domain.com
3. After ensuring (1) and (2) are fixed as above, clear ssl stuff
$ cd /var/lib/puppet/ssl
$ sudo mkdir old
$ sudo mv * old/
4. Now run client again
$ sudo puppetd -tdv
5. On server sign the cert
$ sudo puppetca --list
human01.yourdomain.local
$ sudo puppetca --sign human01.yourdomain.local