You’ve identified a group of nodes where you’d like to enable or disable the Puppet daemon.
Note You can identify nodes where the daemon is enabled or disabled using the steps in Identifying nodes where the Puppet daemon is enabled or disabled.
Version and installation information
PE version: All supported versions
Solution
You can enable or disable groups of agents by installing a module and running tasks.
Get the module and tasks
Download and install the puppetlabs-support_tasks module which includes the tasks for this solution.
To enable agents:
By default, this will enable all agents, however, you can apply it to a set of nodes by editing the list of nodes created in step 1.
-
Create a list of disabled nodes in a file called
nodefile.txt
by running a task. On the master:puppet task run support_tasks::st0285_find_disabled_agents --no-color --query 'nodes[certname] { }' | grep Finished | awk '{printf "%s%s",sep,$NF; sep=",\n"}' > nodefile.txt
Learn more about this task in Identifying nodes where the Puppet daemon is enabled or disabled.
-
Enable all of the agents in the list by running a task with the list of nodes as input. On the master, run:
puppet task run support_tasks::st0286_change_puppet_daemon_runmode puppet_mode=enable --nodes @nodefile.txt
Note: To enable nodes, the required parameter
puppet_mode
is set toenable
.
To disable an agent:
-
Disable an agent by running a task. For example to disable an agent that you’re doing testing on, on the master, run:
puppet task run support_tasks::st0286_change_puppet_daemon_runmode puppet_mode=disable reason='down for testing' --nodes agent1.example.com
Note: To disable nodes, the required parameter
puppet_mode
is set todisable
. Thereason
parameter is optional.
How can we improve this article?
0 comments
Please sign in to leave a comment.
Related articles