Aim
The aim is to disable automatic Puppet-agent runs that occur every 30 minutes. It is possible to change the interval, but the automatic Puppet-agent runs should be disabled completely.
Attempt one
According to this documentation it should be possible to disable automatic Puppet-agent runs by configuring the following:
/etc/puppet/puppet.conf
[agent]
daemonize=false
results in
Notice: Run of Puppet configuration client already in progress;
skipping (/var/lib/puppet/state/agent_catalog_run.lock exists)
if puppet is run manually at the default run interval of 30minutes.
Attempt two
user@hostname:~$ sudo puppet agent --disable
results in
user@hostname:~$ sudo puppet agent -t
Notice: Skipping run of Puppet configuration client;
administratively disabled (Reason: 'reason not specified');
Use 'puppet agent --enable' to re-enable.
Attempt three
This documentation was found after googling the question of this Q&A, but the provided information did not answer the question.
"Attempt one" should have worked. If it was already running you have to stop it yourself. This just prevents future instances from daemonizing. If I am missing something, please clarify why this didn't work. You can also
chkconfig puppet off && service puppet stop
on Red Hat and derivatives.You need to ensure that the puppet agent is not starting as a service. Commands like
systemctl
, orchkconfig
are your friend here (e.g.systemctl disable puppet
orchkconfig puppet off
). Not sure about most distros.Then you should also make sure that the agent is stopped. E.g.
systemctl stop puppet
orservice stop puppet
.Systemd has a shortcut to do both with one command:
systems disable --now puppet
.You can also just use puppet to accomplish the above:
If it still doesn't work,
pkill puppet
for good measure, then try again, if it still doesn't work - reboot.Are you looking for a command like:
I would not expect the daemonize option to affect this - I would expect that to control whether the program backgrounds itself and detaches from the terminal.
https://puppet.com/docs/puppet/latest/configuration.html#runinterval says ...
which seems more relevant (the reference to starting with
--no-client
rather than the setting itself).When we need to stop puppet making regular changes we just stop the service on the managed node. That obviously means that you need to be able to invoke a one-off run through some other mechanism (we don't do this often so just run from the shell).
With this setup
puppetd
is running but not doing regular updates (that's my expectation - I am trying this on a test machine but not enough time has passed yet).Running
puppet agent --test
will cause a single run but won't schedule any future runs.sudo service puppet stop
if you are running the puppet daemonOr delete the cronjob if that is how you have it configured.
returns
returns
The opposite of
stopped
isrunning
. The opposite offalse
istrue
. ;)As I mentioned in linked question, one possibility to have runned puppet-agent and disable configuration run, it change
runinterval
to very large value, like 10 years or something like that. But this solution still trigger configuration run after agent restart.