Simple PuppetDB wrapper
This is a puppet face that will display all exports in puppetdb from the command line
This module is compatible with Puppet Enterprise and Puppet Bolt.
To run tasks with Puppet Enterprise, PE 2017.3 or later must be used.
To run tasks with Puppet Bolt, Bolt 0.5 or later must be installed on the machine from which you are running task commands. The master receiving the task must have SSH enabled.
With Puppet Enterprise 2017.3 or higher, you can run this task from the console or the command line.
Here's a command line example where we are checking for the exported Host resources from the Puppet master,
[abir@workstation]$ puppet task run exports resources=Host --nodes master.corp.net Starting job ... New job ID: 247 Nodes: 1 Started on master.corp.net ... Finished on node master.corp.net STDOUT: Name Exports master.corp.net Host[master.corp.net] Job completed. 1/1 nodes succeeded. Duration: 2 sec
With Bolt, you can run this task on the command line like so:
bolt task run exports resources=Host --nodes master.corp.net
resources: Filter the query to just a particular resource
- Install the module into your modulepath
puppet node exports
An example use would be monitoring students checking into the puppet master in the puppet advanced class
while :; do clear; puppet node exports --highlight; sleep 2; done
or if you do not have
--color in watch:
watch 'puppet node exports'
To query for all exported resources ( be aware there is a 20,000 limit by default )
puppet node exports
Name Exports puppet3.puppetlabs.vm File[/tmp/production_puppet3.puppetlabs.vm_2] puppet3.puppetlabs.vm File[/tmp/production_puppet3.puppetlabs.vm] puppet3.puppetlabs.vm User[foooo]
To query for just user resources
puppet node exports --resources user
Name Exports puppet3.puppetlabs.vm User[foooo]
What are tasks?
Modules can contain tasks that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.