Setup Puppet Master Agent on Ubuntu 12.04 LTS - lifuzu/cafe GitHub Wiki
- 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
- Install puppet master on server side:
$ sudo apt-get install puppetmaster
$ sudo apt-get install puppetmaster-passenger
- Install puppet agent on agent side:
$ sudo apt-get install puppet
- 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
-
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.
-
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
- Run the following command to certificate puppet agent to puppet master:
$ sudo puppet agent --test --waitforcert 60
- Of course, you need go to master side, to sign/accept the agent:
$ sudo puppet cert --list
$ sudo puppet cert --sign [puppet_agent]
- 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
- 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:
- 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
$ sudo touch /etc/puppet/autosign.conf
$ sudo echo "*" > /etc/puppet/autosign.conf
# or
$ sudo echo "*.domainname.com" > /etc/puppet/autosign.conf
$ sudo puppet cert list --all
###References: