Install Puppet Core on Bolt targets

Use a plugin hook to install the current version of Puppet Core on Bolt targets.

By default , with no credentials configured, Bolt installs the last version of open source Puppet on targets instead of the current version of Puppet Core.

If you are using Puppet Enterprise (PE), update Puppet and Facter on targets using PE, not Bolt.

Plugin hook locations

You can configure the plugin hook globally to apply to all Bolt projects or configure it in inventory.yaml for a specific group of targets. When you configure a plugin hook globally, use plugin-hooks, with a hyphen. When you configure the plugin hook in inventory.yaml use plugin_hooks, with an underscore.

If you move plugin hook configuration between bolt-defaults.yaml and inventory.yaml, rename the plugin hook so that installation works successfully.

Configure credentials

To complete these steps, you must have Puppet Core credentials. For more information on credentials, see Purchasing Puppet Core and Accessing Puppet Core for limited use for testing or development.

In the computer that you're running Bolt on, set the environment variable PUPPET_FORGE_TOKEN to the Puppet Core Forge API key associated with your Puppet Core user.

On Linux and macOS:

Copy
export PUPPET_FORGE_TOKEN=<API_KEY>

On Windows in cmd.exe:

Copy
set PUPPET_FORGE_TOKEN = <API_KEY>

Configure a plugin hook globally

To configure a plugin hook globally, add the following code to the top of ~/.puppetlabs/etc/bolt/bolt-defaults.yaml:

Copy
plugin-hooks: 
  puppet_library: 
    plugin: task 
    task: puppet_agent::install 
    parameters: 
      collection: puppetcore8 
      version: latest 
      password: 
        _plugin: env_var 
        var: PUPPET_FORGE_TOKEN 

Configure a plugin hook in inventory.yaml

To configure a plugin hook in inventory.yaml, add the following code to the top of the file:

Copy
plugin_hooks: 
  puppet_library: 
    plugin: task 
    task: puppet_agent::install 
    parameters: 
      collection: puppetcore8 
      version: latest 
      password: 
         _plugin: env_var 
         var: PUPPET_FORGE_TOKEN