If you don’t have root command-line access to Puppet Server, you can run operating system commands on the master using Bolt and the puppetlabs-support_tasks
module to check ports, tail log files for Puppet services, and check the permissions of all folders below ssldir.
Version and installation information
Puppet version: 5.0 to latest
OS: Any master OS
Solution
Before you begin: To use the puppetlabs-support_tasks
module with Bolt, install both on the workstation you will use to run the task.
Use a task in the support_tasks
module to run the following commands on the master:
Command | Command name passed to task | What it does |
puppet_port_status - netstat -ln | grep '8140\|5432\|8170\|8143\|443 \|4433\|8081\|8150\|8151\|8142' |
puppet_port_status |
Check the status of listed Puppet service ports. Puppet uses only port 8140. The task is designed for both Puppet and Puppet Enterprise. |
tail -100 <PATH TO LOG> |
puppetserver_log |
Tail the last 100 lines of the Puppet Server service log. |
puppetdb_log |
Tail the last 100 lines of the PuppetDB service log. | |
syslog_log |
Tail the last 100 lines or either /var/log/messages or /var/log/syslog . |
|
find "$(puppet config print ssldir)" -maxdepth 10 -type d -exec ls -ld "{}" \; |
ssldir_permissions |
Show permissions for all folders below ssldir. |
To use the task
From your Bolt workstation, run the following, with your master as the target: bolt task run support_tasks::st0372_os_commands command=<COMMAND NAME> --targets master --modulepath ~/modules
.
Example:
To get the status of Puppet ports:
bolt task run support_tasks::st0372_os_commands command=puppet_port_status --targets master --modulepath ~/modules
Output:
Started on 192.168.0.20... Finished on 192.168.0.20: Puppetserver node detected tcp6 0 0 :::8140 :::* LISTEN { } Successful on 1 target: 192.168.0.20 Ran on 1 target in 0.87 sec
Learn more about:
Comments
0 comments
Please sign in to leave a comment.