krish – 起死回生 [Wake up from death & return to life.]

October 30, 2011

Puppet Cheat Sheet

Filed under: Free / Open Source — krish @ 6:20 pm
Tags: , , , , , , , , ,

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
...

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:

    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

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Please leave a Reply / Discuss this topic here :)

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

The Male Factor

On behalf of the ignored gender

Rough Draft

by Atteris Amarth and Darrek Ringo

The Kochi Post.

Read by all + Influenced by none

JumboMake

A signature of Kiran

SAAYAM CHEDDAM FOUNDATION

This blog is just for additional and extension share of it's main frames. No activity is planned from here

krish - 起死回生 [Wake up from death & return to life.]

Get a sneak peek into krish's life, work and passion.

WordPress.com

WordPress.com is the best place for your personal blog or business site.

A Tale of Two and a Half

Monika Amita Bakshi

%d bloggers like this: