Install Puppet Core on Bolt targets

You can use Bolt to install Puppet Core on targets by configuring a plugin hook.

By default, with no credentials configured, Bolt installs Puppet 8.10 on targets instead of Puppet Core.

For Puppet Enterprise (PE), use the PE documentation to install PE or upgrade PE.

Understand plugin hook locations

You can configure the plugin hook globally to apply to all Bolt projects or configure the hook in the inventory.yaml file 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 hook. In bolt-defaults.yaml the hook must be named plugin-hooks and in inventory.yaml the hook must named plugin_hooks.

Configure credentials for Puppet Core

To install Puppet Core on Bolt targets, you must obtain and configure Puppet Core credentials. For information on credentials, see Purchasing Puppet Core and Accessing Puppet Core for limited use for testing or development.

On computer running Bolt, 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

Configure a plugin hook globally by adding the following code to the top of the ~/.puppetlabs/etc/bolt/bolt-defaults.yaml 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 

Configure a plugin hook in inventory.yaml

Configure a plugin hook in inventory.yaml by adding 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