Lab – creating and using a Bolt project
In this lab, we will create a Bolt project. We will create a task that runs the facter
command on a Windows and Linux node.
The steps are as follows:
- Create a Bolt project with the following line of code:
bolt project init packtlab
- Create an
inventory.yaml
file by performing a lookup of Windows and Linux clients from the PECDM Bolt project and copying the output:bolt inventory show --targets agent_nodes --detail bolt inventory show --targets windows_agent_nodes --detail
- Write a task to cover both Windows and Linux that runs the
facter
command, taking a single argument if only a single fact should be returned. - Write a plan that uses
run_command
to runfacter
and return the results of the plan. - Run the task and plan on your Windows and Linux clients.
- You can find example solutions at https://github.com/PacktPublishing/Puppet-8-for-DevOps-Engineers/tree/main/ch12.