1
votes

I am using the following Puppet version on CentOS Linux release 7.2:

# puppetserver -v
puppetserver version: 2016.5.0.11

I have a Win agent node and i might have few more later. Agent version on Win node:

C:\Windows\system32>puppet --version
4.8.1

I would like to disable the agent runinterval permanently so i can only push from my Puppet server when required. I saw few links and tried putting the following line in Puppet server's /etc/puppetlabs/puppet/puppet.conf file. I also restarted the server but still the agent is fetching the catalog.

[agent]
daemonize=false

I would also like to know whether it's possible to disable runinterval only on specific nodes. If yes, how?

2
You have a good answer explaining how to prevent the agent from issuing catalog requests, but it's unclear to me how you expect to implement any kind of pushing from the master to other nodes. Not via Puppet, certainly, unless this is a PE feature I don't know about. Puppet has never had a push feature, though until Puppet 4 it had a remotely-trigger-a-catalog-request feature (which required the agent to be running, but not necessarily configured to issue catalog requests). - John Bollinger
Though i didn't go into the implementation, i thought mco will be of help in pushing changes. Is that not possible while keeping the agent service disabled? - Technext
You can use MCollective to cause agents to perform catalog runs on demand. If that serves your needs then well and good. However, it is not technically a push, and it is not facilitated by core Puppet. These fine distinctions may not matter to you. - John Bollinger
So does it mean i will have to keep the agent service enabled? If that's the case, then may be i will have to set the runinterval to a very large number making it effectively disabled. - Technext
No, if you're planning to use MCollective to trigger catalog runs, then you do not need the Puppet service to be enabled. I am primarily pointing out that doing so is not technically a push. That may not matter for you, but it does differ in some details that could matter. For example, with a push, the agents would not need to be able to initiate connections with the master, but with your approach they will need to be able to do, even though they will do it only at times you choose. - John Bollinger

2 Answers

2
votes

What you are basically looking at doing is stopping the Puppet service. This is accomplished most easily with a puppet service resource:

service { 'puppet':
  ensure => stopped,
  enable => false,
}

To do this only on certain nodes, merely supply it for the corresponding node definitions in your classifier or main site manifest:

node /ones_to_disable/ {
  service { 'puppet':
    ensure => stopped,
    enable => false,
  }
}

This is the easy and common method for accomplishing push-style Puppet and disabling pull-style.

0
votes

If you want to disable Puppet agent on given node you have to use this command: puppet agent --disable. You can specify a reason, why you are disabling agent on given node. The message that you could supply will be printed next time someone will type puppet agent on node.