If you don't have root command line access to run Puppet commands, you can run them via Bolt using a task in the puppetlabs-support_tasks
module. You can use these commands to see the actual settings values that a Puppet service uses and list your modules in all environments.
Version and installation information
Puppet version: 4.0 to latest
Solution
Before you begin: To use the puppetlabs-support_tasks
module with Bolt, install both on the workstation youโll run the task from.
By using a task from the support_tasks
module, you can run the following commands via Bolt:
config_print
- See the actual settings values that a Puppet service uses.module_list
- List installed modules in all environments.infrastructure_status
- (Puppet Enterprise only.) Display errors and alerts from PE services.tune
- (Puppet Enterprise only.) Output optimized tuning parameters based on recommended guidelines.
To use the task
From your Bolt workstation, run the following, with your master as the target: : bolt task run support_tasks::st0371_puppet_commands command=<COMMAND> --targets <MASTER> --modulepath ~/modules
.
Example:
bolt task run support_tasks::st0371_puppet_commands command="module_list" -t master --modulepath="/etc/puppetlabs/code/environments/production/modules"
Output:
Started on 192.168.0.20...
Finished on 192.168.0.20:
Puppetserver node detected
/etc/puppetlabs/code/environments/production/modules
โโโ puppetlabs-support_tasks (v1.1.1)
/etc/puppetlabs/code/modules (no modules installed)
/opt/puppetlabs/puppet/modules (no modules installed)
{
}
Successful on 1 target: 192.168.0.20
Ran on 1 target in 2.27 sec
Learn more about:
Comments
0 comments
Please sign in to leave a comment.