The Puppet agent daemon is disabled on some of your nodes. You'd like to know which nodes are enabled and which nodes are disabled in the command line or in the console.
Version and installation information
PE version: All supported versions
OS: Unix, Windows
Solution
Identify which nodes are enabled and disabled by running tasks in the support_tasks
module.
Note: You can use the output from the tasks in this article to enable the daemon on nodes where it is disabled.
-
Download and install the
support_tasks
module which includes the tasks for this solution. -
On the command line:
Select the appropriate task. If you need to run two tasks, run the second task when the first task is finished running.
Create a list of disabled nodes in a file (
nodefile.txt
) by running a task on the primary server. For example: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
To show a list of disabled nodes on the screen in PE, on the primary server, run:
puppet task run support_tasks::st0285_find_disabled_agents --no-color --query 'nodes[certname] { }' | grep Finished | awk '{printf "%s%s",sep,$NF; sep=",\n"}' && echo
In the console:
Follow the instructions in our documentation for using tasks in the console. You can select nodes using a PQL query, node list, or node group. Select the appropriate task. You can't run two tasks at the same time. If you need to run two tasks, run the second task when the first task is finished running.
For example, to select all nodes, under Inventory select PQL and under common queries select All nodes. Click Submit query and click Refresh to update the node results. Click Run job.
Example output:
The output for enabled nodes contains an error so that you can sort enabled and disabled nodes in the console:
Started on pe-201813-primary-server.platform9.puppet.net ...
Failed on pe-201813-primary-server.platform9.puppet.net
Error: Task finished with exit-code 1
STDOUT:
Puppet agent is enabled
Job failed. 1 node failed, 0 nodes skipped, 0 nodes succeeded.
Duration: 0 sec
The output for a disabled node:
Started on pe-201813-primary-server.platform9.puppet.net ... Finished on node pe-201813-primary-server.platform9.puppet.net STDOUT: Puppet agent is disabled Job completed. 1/1 nodes succeeded. Duration: 0 sec
How can we improve this article?
0 comments
Please sign in to leave a comment.
Related articles