2

I've installed a puppetmaster as described here. Now, I need to add a few puppet agents. How can I do that?

3

Do note: This should work (and has been tested on) Ubuntu 10.04 and 12.04.

Now, we're going to use the official Puppet repo, since it has newer versions of most of it.

To do that,

wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
sudo dpkg -i puppetlabs-release-precise.deb

Now we have the puppet repository added.

sudo apt-get update 

Now we have updated our sources.list, so apt-get knows where to find the puppet package.

sudo apt-get install puppet

make sure you can ping the puppet master at 'puppet'.

Now, you need to use the root user for this.

Run

sudo -i

on both the agent and the puppetmaster.

Now, on the agent:

puppet agent --test

It should return some output like this:

root@puppetslave2:~# puppet agent --test
info: Creating a new SSL key for puppetslave2.home
warning: peer certificate won't be verified in this SSL session
info: Caching certificate for ca
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
info: Creating a new SSL certificate request for puppetslave2.home
info: Certificate Request fingerprint (md5): 04:8F:9A:99:0F:FF:26:7C:FC:2D:9C:8B:B8:B8:DF:17
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
Exiting; no certificate found and waitforcert is disabled

on master:

puppet cert list

root@puppet:~# puppet cert list
  puppetslave2.home (04:8F:9A:99:0F:FF:26:7C:FC:2D:9C:8B:B8:B8:DF:17)

puppet cert sign puppetslave2.home

And then the output should be something like this:

root@puppet:~# puppet cert sign puppetslave2.home
notice: Signed certificate request for puppetslave2.home
notice: Removing file Puppet::SSL::CertificateRequest puppetslave2.home at '/var/lib/puppet/ssl/ca/requests/puppetslave2.home.pem'

now go do

puppet agent --test

on the agent. it should succeed, if you have a manifest on the puppetmaster for it. Example one below:

node 'puppetslave2.home' {

    file { '/etc/motd':
     content => "Welcome. 
          This machine is managed by Puppet
    "
    }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.