Enable Code Manager

Set parameters in the console to enable Code Manager and connect your primary server to your Git repository.

Before you begin:

Set up an SSH key to permit the pe-puppet user to access your Git repositories. The SSH key must be:

  • Owned by the pe-puppet user.
  • Located on the primary server.
  • Located in a directory the pe-puppet user has permission to view, such as /etc/puppetlabs/puppetserver/ssh/id-control_repo.ed25519.

These steps use the puppet job command. To use this command, you must have permission to run jobs and have access to the primary server.

  1. In the console, click Node groups, locate the PE Master node group, and set these parameters for the puppet_enterprise::profile::master class:
    1. Set code_manager_auto_configure to true to enable Code Manager.
    2. For r10k_remote, enter a string that is a valid SSH URL for your Git control repository, such as git@<YOUR.GIT.SERVER.COM>:puppet/control.git.
      Some Git providers have additional requirements for enabling SSH access. For example, BitBucket requires ssh:// at the beginning of the SSH URL (such as ssh://git@<YOUR.GIT.SERVER.COM>:puppet/control.git). See your provider's documentation for this information.
    3. For r10k_private_key, enter a string specifying the path to the SSH private key that permits the pe-puppet user to access your Git repositories, such as "/etc/puppetlabs/puppetserver/ssh/id-control_repo.ed25519".
      If your PE installation includes disaster recovery, you must also set the puppet_enterprise::profile::master::r10k_private_key parameter in pe.conf. This ensures that the r10k private key is synced to your primary server replica.
    4. For the r10k_known_hosts parameter, enter an array of hashes, with each hash containing the following key-value pairs:
      • "name":"<HOSTNAME>": Specify the hostname of your control repository host.
      • "type":"<HOST_KEY_TYPE>": Specify the type of host key, such as rsa, dsa, ecds, or ed25519.
      • "key":"<HOST_PUBLIC_KEY>": Specify the SSH public key for your control repository host.

      Structure the parameter as shown in the following example:

      [{"name":"<HOSTNAME>","type":"<HOST_KEY_TYPE>","key":"<HOST_PUBLIC_KEY>"},{"name":"<HOSTNAME>","type":"<HOST_KEY_TYPE>","key":"<HOST_PUBLIC_KEY>"}]

      Optionally, each hash can accept values for "title", "ensure", and "host_aliases".

      The r10k_known_hosts parameter manages your known_hosts file to allow SSH host key verification, which is required when you use Code Manager or r10k.

  2. Click Commit.
  3. On the command line, run puppet job run --nodes <NODE NAME> where <NODE NAME> is the name of your primary server. For example:
    puppet job run --nodes small-doubt.delivery.puppetlabs.net
What to do next
Set up authentication for Code Manager.

Related information