Point PE to a Bolt project
Allow PE to manage content in your dedicated Bolt repo.
Before you begin:
- Install PE on your machine. See Getting started with Puppet Enterprise.
- Ensure your Bolt project follows the local project directory structure.
To point PE to your Bolt content:
- To allow access to the control repo, generate a private SSH key without a password:
- To generate the key pair, run:
ssh-keygen -t ed25519 -P '' -f /etc/puppetlabs/puppetserver/ssh/id-control_repo.ed25519
- To allow the
pe-puppet
user to access the key, run:puppet infrastructure configure
Your private key is located at
/etc/puppetlabs/puppetserver/ssh/id-control_repo.ed25519
, and your public key is at/etc/puppetlabs/puppetserver/ssh/id-control_repo.ed25519.pub
. - Configure your Git host to use the SSH public key you generated. Usually, this involves creating a user or service account and assigning the SSH public key to it, but the exact process varies for each Git host. For instructions on adding SSH keys to your Git server, check your Git host's documentation (such as GitHub, BitBucket Server, or GitLab).Code management needs read access to your control repository, as well as any module repositories referenced in the Puppetfile.
- To generate the key pair, run:
- Change the name of your branch to
production
. PE uses branches in Git as environments and the default environment isproduction
. - Create a configuration file called
environment.conf
and add it to the root directory of the branch. This file configures the environment. - Add the
modulepath
setting to theenvironment.conf
file by adding the following line:modulepath = modules:modules:$basemodulepath
PE picks up modules only from themodules
directory. It's important to addmodules
to themodulepath
setting so it matches the defaults for your Bolt project. If you have amodulepath
setting inbolt-project.yaml
, match it to themodulepath
setting inenvironment.conf
. - Publish the branch to the PE control repo.
- Deploy code using
puppet code deploy --<ENVIRONMENT>
, where<ENVIRONMENT>
is the name of your branch, to commit the new branch to Git.You can also deploy code using a webhook. See Triggering Code Manager with a webhook for more information.
Results
After you deploy code, modules (and the tasks and plans within them) listed in the new environment's Puppetfile are available to use in PE.
After you deploy code, modules (and the tasks and plans within them) listed in the new environment's Puppetfile are available to use in PE.