> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/artifact-registry/new-to-artifact-registry/quickstart/puppet-quickstart.md).

# Puppet

{% @harness-package-selector/package-selector platforms="%5B%7B%22label%22%3A%22Docker%22%2C%22slug%22%3A%22docker%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fdocker-quickstart%22%7D%2C%7B%22label%22%3A%22Helm%22%2C%22slug%22%3A%22helm%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fhelm-quickstart%22%7D%2C%7B%22label%22%3A%22Helm%20HTTP%22%2C%22slug%22%3A%22helm-http%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fhelm-http-quickstart%22%7D%2C%7B%22label%22%3A%22Generic%22%2C%22slug%22%3A%22generic%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fgeneric-quickstart%22%7D%2C%7B%22label%22%3A%22Raw%20File%22%2C%22slug%22%3A%22raw-file%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fraw-file-quickstart%22%7D%2C%7B%22label%22%3A%22Maven%22%2C%22slug%22%3A%22maven%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fmaven-quickstart%22%7D%2C%7B%22label%22%3A%22Python%22%2C%22slug%22%3A%22python%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fpython-quickstart%22%7D%2C%7B%22label%22%3A%22NPM%22%2C%22slug%22%3A%22npm%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fnpm-quickstart%22%7D%2C%7B%22label%22%3A%22Nuget%22%2C%22slug%22%3A%22nuget%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fnuget-quickstart%22%7D%2C%7B%22label%22%3A%22RPM%22%2C%22slug%22%3A%22rpm%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Frpm-quickstart%22%7D%2C%7B%22label%22%3A%22Debian%22%2C%22slug%22%3A%22debian%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fdebian-quickstart%22%7D%2C%7B%22label%22%3A%22Alpine%22%2C%22slug%22%3A%22alpine%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Falpine-quickstart%22%7D%2C%7B%22label%22%3A%22Wolfi%22%2C%22slug%22%3A%22wolfi%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fwolfi-quickstart%22%7D%2C%7B%22label%22%3A%22Cargo%22%2C%22slug%22%3A%22cargo%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fcargo-quickstart%22%7D%2C%7B%22label%22%3A%22Conan%22%2C%22slug%22%3A%22conan%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fconan-quickstart%22%7D%2C%7B%22label%22%3A%22Go%22%2C%22slug%22%3A%22go%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fgo-quickstart%22%7D%2C%7B%22label%22%3A%22Hugging%20Face%22%2C%22slug%22%3A%22hugging-face%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fhugging-face-quickstart%22%7D%2C%7B%22label%22%3A%22Conda%22%2C%22slug%22%3A%22conda%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fconda-quickstart%22%7D%2C%7B%22label%22%3A%22Dart%22%2C%22slug%22%3A%22dart%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fdart-quickstart%22%7D%2C%7B%22label%22%3A%22PHP%20Composer%22%2C%22slug%22%3A%22php-composer%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fphp-composer-quickstart%22%7D%2C%7B%22label%22%3A%22Swift%22%2C%22slug%22%3A%22swift%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fswift-quickstart%22%7D%2C%7B%22label%22%3A%22Puppet%22%2C%22slug%22%3A%22puppet%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fpuppet-quickstart%22%7D%2C%7B%22label%22%3A%22Terraform%22%2C%22slug%22%3A%22terraform%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fterraform-quickstart%22%7D%2C%7B%22label%22%3A%22R%20(CRAN)%22%2C%22slug%22%3A%22r-cran%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Fr-cran-quickstart%22%7D%2C%7B%22label%22%3A%22RubyGems%22%2C%22slug%22%3A%22rubygems%22%2C%22path%22%3A%22artifact-registry%2Fnew-to-artifact-registry%2Fquickstart%2Frubygems-quickstart%22%7D%5D" selectedPlatform="puppet" %}

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* **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](/harness-ai/use-harness-platform/platform-access-control.md) to configure roles.

***

### Create a Puppet Artifact Registry <a href="#create-a-puppet-artifact-registry" id="create-a-puppet-artifact-registry"></a>

{% tabs %}
{% tab title="Interactive Guide" %}
{% embed url="<https://app.tango.us/app/embed/8ae2d04e-a983-4701-b00f-ecc47edf973b?defaultListView=false&hideAuthorAndDetails=true&makeViewOnly=false&skipBranding=false&skipCover=false>" %}
{% endtab %}

{% tab title="Step-by-Step" %}

1. Go to the Artifact Registry module in your Harness project.
2. Select **New Artifact Registry**.
3. In the Registry Type list, select **Puppet Registry**.
4. Provide a Registry Name.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>REGISTRY NAME REQUIREMENTS</strong></p><p>This registry name must start with a letter and can only contain lowercase alphanumerics, <code>_</code>, <code>.</code> and <code>-</code>, and <strong>must be unique to your Harness Account</strong>.</p></div>
5. Optionally, add a Description and Labels for better organization.
6. Choose visibility between **Public** and **Private**.
7. Select **Create Registry** to finalize.
   {% endtab %}
   {% endtabs %}

{% hint style="info" %}
**PRIVATE PUPPET REGISTRY**

This registry will serve as your private Puppet module registry within Harness.
{% endhint %}

***

### Configure an upstream proxy (optional) <a href="#configure-an-upstream-proxy-optional" id="configure-an-upstream-proxy-optional"></a>

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

{% tabs %}
{% tab title="Interactive Guide" %}
{% embed url="<https://app.tango.us/app/embed/0a1bd8d6-33ab-4175-aeca-3f75ad618249>" %}

{% embed url="<https://app.tango.us/app/embed/e7aa4f88-6287-4169-9fdc-36b6d31baed8>" %}
{% endtab %}

{% tab title="Step-by-Step" %}

#### Create an upstream proxy <a href="#create-an-upstream-proxy" id="create-an-upstream-proxy"></a>

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 <a href="#configure-the-upstream-proxy-in-your-registry" id="configure-the-upstream-proxy-in-your-registry"></a>

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.
   {% endtab %}
   {% endtabs %}

{% hint style="info" %}
**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.
{% endhint %}

***

### Set up the client <a href="#set-up-the-client" id="set-up-the-client"></a>

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

#### 1. Configure authentication <a href="#id-1-configure-authentication" id="id-1-configure-authentication"></a>

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 <a href="#id-2-install-a-puppet-module" id="id-2-install-a-puppet-module"></a>

{% tabs %}
{% tab title="Puppet" %}
Edit `/etc/puppetlabs/puppet/puppet.conf`:

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

Install the module:

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

{% endtab %}

{% tab title="r10k" %}
Edit `r10k.yaml`:

```yaml
forge:
  baseurl: 'https://pkg.harness.io/pkg/<ACCOUNT_ID>/<REGISTRY_NAME>/puppet'
  authorization_token: 'Bearer <API_KEY>'
```

Add the module to your Puppetfile:

```ruby
mod '<ARTIFACT_NAME>', '<VERSION>'
```

Resolve the Puppetfile:

```bash
r10k puppetfile install
```

{% endtab %}
{% endtabs %}

#### 3. Upload a Puppet module <a href="#id-3-upload-a-puppet-module" id="id-3-upload-a-puppet-module"></a>

Upload the module tarball using the Harness CLI:

```bash
hc artifact push puppet <REGISTRY_NAME> <FILE_PATH>
```
