Point PE to a Bolt project

Allow PE to manage content in your dedicated Bolt repo.

Before you begin:

To point PE to your Bolt content:

  1. To allow access to the control repo, generate a private SSH key without a password:
    1. To generate the key pair, run:
      ssh-keygen -t ed25519 -P '' -f /etc/puppetlabs/puppetserver/ssh/id-control_repo.ed25519
    2. 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.

    3. 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.
  2. Change the name of your branch to production. PE uses branches in Git as environments and the default environment is production.
  3. Create a configuration file called environment.conf and add it to the root directory of the branch. This file configures the environment.
  4. Add the modulepath setting to the environment.conf file by adding the following line:
    modulepath = modules:modules:$basemodulepath
    PE picks up modules only from the modules directory. It's important to add modules to the modulepath setting so it matches the defaults for your Bolt project. If you have a modulepath setting in bolt-project.yaml, match it to the modulepath setting in environment.conf.
  5. Publish the branch to the PE control repo.
  6. 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.

Related information