4

I'm on ubuntu, is this the correct way to get puppet to start on reboots?

update-rc.d puppet default

If yes, where can I see the result of that command? Does it update a file that gets called on reboots?

Is this the same process for both the puppet master server and the puppet agent servers?

Update Just in case the puppet agent already runs after reboots using the default installs on ubuntu using:

sudo apt-get puppet facter

How can I know if is already setup to start on reboots?

4 Answers 4

9

The puppet agent package doesn't set itself to start at boot by default, so that you have a chance to configure it as needed before it starts doing its thing (and potentially making massive changes to the system). It warns about this when you try to start the service.

Modify /etc/default/puppet, changing START=no to START=yes, then start the service with service puppet start.

The puppetmaster package should be starting at boot automatically as soon as it's installed.

3
  • how should I be starting/stoping the puppetmaster, using service puppet restart, or /etc/init.d/puppetmaster or invoke-rc.d ? which one is the best way here?
    – Blankman
    May 29, 2011 at 22:09
  • 2
    service puppetmaster restart or /etc/init.d/puppetmaster restart; the "proper" way is with the service command. Note that the "puppet" service is the agent only, while "puppetmaster" is for the master. May 29, 2011 at 22:28
  • puppet module install cprice404/inifile; puppet apply -e "ini_setting { enablepuppet: ensure => present, path => '/etc/default/puppet', section => '', setting => 'START', value => 'yes' }"
    – Garth Kidd
    Jan 30, 2013 at 6:33
3

The puppet way, once you have puppet installed you can use puppet resource (or ralsh on 0.25):

puppet resource service puppet ensure=running enable=true
1

That should set the service to start on boot. You can do a ls of /etc/rcX.d/*puppet (where X is the default runlevel of your system) to make sure it is set to come up on boot. If there is a puppet file with a capital S, it is set (for example, S85puppet). The "S" at the beginning tells the system to execute the script at startup.

8
  • what would my default run level be? I'm not sure. it's a new ec2 instance.
    – Blankman
    May 29, 2011 at 20:17
  • ok I found S21puppet in many of the rc4.d etc folders.
    – Blankman
    May 29, 2011 at 20:19
  • when I do a: px aux I don't see puppet anywhere in the list, that is confusing me.
    – Blankman
    May 29, 2011 at 20:19
  • actually looking at the run folder, it sais PID 573, so using ps aux I see: /usr/bin/ruby1. that's a pretty cryptic way of knowing that it is puppet agent running no?
    – Blankman
    May 29, 2011 at 20:23
  • 1
    @Blankman Just checked this faq, Debian is run level 2 by default. May 29, 2011 at 21:46
0

I like to put a puppet agent run in /etc/rc.local so that puppet will apply a fresh catalog upon boot, and will log any changes to the console.

do:

echo "puppetd --test" >> /etc/rc.local

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .