Date: 2024-05-01
Accepted
A typical command in bolt specifies the --targets
or the hosts on which to run a specific set of commands. For example, bolt plan run vmfloaty::test --targets=flaxen-green.vmpooler-prod.puppet.net
will run the vmfloaty::test
plan on the host flaxen-green.vmpooler-prod.puppet.net
. Since this hostname is not only hard to remember but a bit cumbersome to type out, I'd like to shorten the target in the bolt inventory.
One way to do this is to associate a "name", like flaxen-green
alongside the required "uri" of flaxen-green.vmpooler-prod.puppet.net
Therefore, I decided to change generate_inventory.rb
so that it always creates a short name
for each target in the bolt inventory.
Now this:
bolt plan run vmfloaty::test --targets=flaxen-green.vmpooler-prod.puppet.net
becomes this:
bolt plan run vmfloaty::test --targets=flaxen-green