Puppet#

Puppet is an open-source configuration management and deployment tool. The operator uses it on engagements to manage agents on a fleet, sign certs from the master, and push or audit modules across nodes.

Services#

Command

Effect

service puppetserver start

Start Puppet server service.

chkconfig puppetserver on

Enable Puppet server service on boot.

service start puppet

Start Puppet agent service.

chkconfig puppet on

Enable Puppet agent service on boot.

Certificates#

Run on the master.

Command

Effect

puppet cert list

List available nodes to sign.

puppet cert list --all

List all signed nodes.

puppet cert sign <name>

Manually sign a specific node.

puppet cert sign --all

Sign all nodes.

puppet cert clean <name>

Remove the cert.

Nodes#

Command

Effect

puppet node clean <name>

Remove node and cert.

Modules#

Run on the master.

Command

Effect

puppet module list

List currently installed modules.

puppet module install <name>

Install module from forge.puppetlabs.com.

puppet module uninstall <name>

Remove the module.

puppet module upgrade <name>

Upgrade to a new version of the module.

puppet module search <name>

Search modules on forge.puppetlabs.com.

Agent#

Command

Effect

puppet agent --test

Run Puppet agent on demand.

puppet agent --disable

Disable Puppet agent.

puppet agent --enable

Enable Puppet agent.

puppet agent --configprint config

Print location of Puppet agent configuration file.

puppet agent -t --noop

Preview what Puppet will change without making the changes.

puppet agent -t --noop /path/to/puppetcode.pp

Preview changes for a particular module.

puppet agent --configprint runinterval

Check the runtime interval.

Config#

Auto cert sign on master, edit /etc/puppetlabs/puppet/autosign.conf.

*.<DOMAIN>

Change run interval on the agent, edit /etc/puppetlabs/puppet/puppet.conf.

[agent]
runinterval = 1800

Default is every 30 minutes (1800 seconds).

Change agent environment, edit /etc/puppetlabs/puppet/puppet.conf.

[main]
environment = <ENVIRONMENT>

Default is production.

Change agent default master, edit /etc/puppetlabs/puppet/puppet.conf.

[main]
server = <PUPPET_SERVER>

Default is puppet.

Triage#

Command

Effect

ping <IP>

Reach the Puppet master by IP first.

ping puppet

Short domain name reach to the Puppet master.

ping puppet.example.com

Make sure FQDN can reach the Puppet master.

vi /etc/hosts

Check both FQDN and short domain are entered in client DNS.

nslookup puppet.example.com

If using DNS server side, check nameservers can resolve the name.

vi /etc/resolv.conf

Check DNS configuration on the client.

service network restart

Restart connection, check for errors.

vi /etc/puppetlabs/puppet/puppet.conf

If using a custom server, check the config is correct for non-default.

telnet puppet.example.com 8140

Test connection to Puppet server on port 8140.

date -R

If time is out of sync, get it in sync with the master.

SSL#

Command

Effect

puppet cert clean node.example.com

Clean node on the master.

rm -rf $(puppet agent --configprint ssldir)

Remove SSL certificate on the node.

puppet agent --test

Run Puppet agent on the node.

References#