Enable Code Manager
Set parameters in the console to enable Code Manager and connect your primary server to your Git repository.
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.
- In the console, click Node groups, locate the
PE Master node group, and set these parameters for
the
puppet_enterprise::profile::master
class:- Set
code_manager_auto_configure
totrue
to enable Code Manager. - For
r10k_remote
, enter a string that is a valid SSH URL for your Git control repository, such asgit@<YOUR.GIT.SERVER.COM>:puppet/control.git
.Some Git providers have additional requirements for enabling SSH access. For example, BitBucket requiresssh://
at the beginning of the SSH URL (such asssh://git@<YOUR.GIT.SERVER.COM>:puppet/control.git
). See your provider's documentation for this information. - For
r10k_private_key
, enter a string specifying the path to the SSH private key that permits thepe-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 thepuppet_enterprise::profile::master::r10k_private_key
parameter inpe.conf
. This ensures that the r10k private key is synced to your primary server replica. - 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 asrsa
,dsa
,ecds
, ored25519
."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 yourknown_hosts
file to allow SSH host key verification, which is required when you use Code Manager or r10k.
- Set
- Click Commit.
- 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
Set up authentication for Code Manager.