puppet-quickstart
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
- Interactive Guide
- Step-by-Step
- Go to the Artifact Registry module in your Harness project.
- Select New Artifact Registry.
- In the Registry Type list, select Puppet Registry.
- Provide a Registry Name.
Registry name requirements
This registry name must start with a letter and can only contain lowercase alphanumerics,
_,.and-, and must be unique to your Harness Account. - Optionally, add a Description and Labels for better organization.
- Choose visibility between Public and Private.
- Select Create Registry to finalize.
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.
- Interactive Guide
- Step-by-Step
Create an upstream proxy
- In the Artifact Registry module, select the dropdown next to New Artifact Registry and select Upstream Proxy.
- Choose Puppet Registry as the proxy type.
- Enter an upstream proxy name.
- Enter your remote registry URL (for example,
https://forgeapi.puppet.com). - Choose your Authentication method (
Anonymousby default). - Select Create Proxy to establish the connection.
Configure the upstream proxy in your registry
- In the Artifact Registry module, select an existing Artifact Registry.
- Select the Configuration tab.
- Under Advanced (Optional), select Configure Upstream.
- Select from the list of compatible proxies to add them to your registry.
- Select Save to save the configuration.
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
- Puppet
- r10k
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>
Edit r10k.yaml:
forge:
baseurl: 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/puppet'
authorization_token: 'Bearer <API_KEY>'
Add the module to your Puppetfile:
mod '<ARTIFACT_NAME>', '<VERSION>'
Resolve the Puppetfile:
r10k puppetfile install
3. Upload a Puppet module
Upload the module tarball using the Harness CLI:
hc artifact push puppet <REGISTRY_NAME> <FILE_PATH>