When accessing a Puppet repository through Artifactory, the repository URL path must be prefixed with api/puppet
.
This applies to all Puppet commands including puppet module install
and puppet module search.
For example, if you are using Artifactory standalone or as a local service, you would access your Puppet repositories using the following URL:
http://localhost:8081/artifactory/api/puppet/<REPO_KEY>
Or, if you are using Artifactory Cloud the URL would be:
https://<server name>.jfrog.io/artifactory/api/puppet/<REPO_KEY>
To use the Puppet command line you need to make sure Puppet is installed on your client.
Once you have created your Puppet repository, you can select it in the Application Module | Artifactory | Artifacts Tree Browser and click the Set Me Up button to get helpful code snippets. These allow you to change your Puppet repository URL in the puppet.conf
file, and resolve modules using the Puppet command line tool.
Replacing the default repository
To replace the default repository with a URL pointing to a Puppet repository in Artifactory, add the following in your puppet.conf
file:
Note: This example uses a repository with the key puppet
.
[main] module_repository=http://localhost:8080/artifactory/api/puppet/puppet
Tip: We recommend referencing a Virtual Repository URL as a repository. This gives you the flexibility to reconfigure and aggregate other external sources and local repositories of Puppet modules you deploy.
Note that if you do this, you can also use the --module_repository
parameter to specify the local repository from which you want to resolve your module when using the Puppet module install command.
Once the Puppet command line tool is configured, every puppet module install
command will fetch packages from the Puppet repository specified above. For example:
$ puppet module install --module_repository=http://localhost:8080/artifactory/api/puppet/puppet puppetlabs-mysql Notice: Preparing to install into /Users/jainishs/.puppetlabs/etc/code/modules ... Notice: Downloading from http://localhost:8080/artifactory/api/puppet/puppet ... Notice: Installing -- do not interrupt ... /Users/jainishs/.puppetlabs/etc/code/modules └── puppetlabs-mysql (v3.10.0)