Skip to main content

puppet-quickstart

Last updated on

Before you begin

  • Puppet CLI or r10k: Install and configure on your local machine before proceeding.
  • Harness permissions: Registry-create access in the target project. Go to RBAC in Harness to configure roles.

Create a Puppet Artifact Registry

Private Puppet registry

This registry will serve as your private Puppet module registry within Harness.


Configure an upstream proxy (optional)

An upstream proxy allows your registry to fetch Puppet modules from external sources (such as the Puppet Forge) if they are not available locally.

Create an upstream proxy

  1. In the Artifact Registry module, select the dropdown next to New Artifact Registry and select Upstream Proxy.
  2. Choose Puppet Registry as the proxy type.
  3. Enter an upstream proxy name.
  4. Enter your remote registry URL (for example, https://forgeapi.puppet.com).
  5. Choose your Authentication method (Anonymous by default).
  6. Select Create Proxy to establish the connection.

Configure the upstream proxy in your registry

  1. In the Artifact Registry module, select an existing Artifact Registry.
  2. Select the Configuration tab.
  3. Under Advanced (Optional), select Configure Upstream.
  4. Select from the list of compatible proxies to add them to your registry.
  5. Select Save to save the configuration.
Upstream proxy caching

If a Puppet module is not found in your Harness registry, the upstream proxy fetches it from an external registry like the Puppet Forge, reducing duplication and improving module resolution.


Set up the client

With your Puppet registry created, you can now authenticate with your Harness registry using Puppet CLI or r10k.

1. Configure authentication

In your Harness Puppet Artifact Registry, select Setup Client and then Generate Token to generate an identity token for authentication.

2. Install a Puppet module

Edit /etc/puppetlabs/puppet/puppet.conf:

[main]
module_repository = https://<USERNAME>:<API_KEY>@pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/puppet

Install the module:

puppet module install <ARTIFACT_NAME> --version <VERSION>

3. Upload a Puppet module

Upload the module tarball using the Harness CLI:

hc artifact push puppet <REGISTRY_NAME> <FILE_PATH>