Setup Puppet Master Agent on Ubuntu 12.04 LTS - lifuzu/cafe GitHub Wiki

Install puppet and puppetmaster

  1. Using puppet labs' package to get the latest version:

$ wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
$ sudo dpkg -i puppetlabs-release-precise.deb
$ sudo apt-get update
  1. Install puppet master on server side:

$ sudo apt-get install puppetmaster
$ sudo apt-get install puppetmaster-passenger
  1. Install puppet agent on agent side:

$ sudo apt-get install puppet
  1. Configure a different port for puppet master (since the default port 8140 occupied by another service): Change the Apache configuration file: /etc/apache2/sites-available/puppetmaster

-Listen 8140
-<VirtualHost *:8140>
+Listen 8141
+<VirtualHost *:8141>

then reboot the Apache service:


$ sudo /etc/init.d/apache2 restart
  1. If the Apache2 is running normally, you should open browser: https://[puppetmaster_hostname]:8141, and get a message: "the environment must be purely alphanumeric not ''", it approved your puppet master is ready.

  2. On agent side, open the puppet configuration file: /etc/puppet/puppet.conf, add the following lines in the [main] section:


server = [puppetmaster_hostname]
report = true
pluginsync = true
certname = [puppet_agent]
masterport = 8141
  1. Run the following command to certificate puppet agent to puppet master:

$ sudo puppet agent --test --waitforcert 60
  1. Of course, you need go to master side, to sign/accept the agent:

$ sudo puppet cert --list
$ sudo puppet cert --sign [puppet_agent]
  1. It should be done, to connect agent(s) to the puppet master:

$ sudo puppet agent --test
Info: Caching certificate_revocation_list for ca
Info: Retrieving plugin
Info: Caching catalog for [puppet_agent]
Info: Applying configuration version '1375751640'
Info: Creating state file /var/lib/puppet/state/state.yaml
  1. If all works well, you’ll want to make sure the WEBrick service no longer starts on boot:

$ sudo update-rc.d -f puppetmaster remove

Note:

  1. If connection from agent to master has some issue, you can try the telnet command to make sure the master (hostname/port) is ready:

$ telnet [puppetmaster_hostname] 8141
Trying [puppetmaster_ipaddress]...
Connected to [puppetmaster_hostname].
Escape character is '^]'.

###Upgrade puppetmaster

$ sudo apt-get install puppetmaster
$ sudo /etc/init.d/apache2 restart

Autosign puppet agent

$ sudo touch /etc/puppet/autosign.conf
$ sudo echo "*" > /etc/puppet/autosign.conf
# or
$ sudo echo "*.domainname.com" > /etc/puppet/autosign.conf

List all puppet agent

$ sudo puppet cert list --all

###References:

  1. http://docs.puppetlabs.com/guides/installation.html
  2. http://example42.com/tutorials/build/deck/advanced
⚠️ **GitHub.com Fallback** ⚠️