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
.
- 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. - If you want to enable lockless code deploys, ensure that the
versioned_deploys
parameter is set totrue
.With the lockless code deploys feature enabled, code deployments are saved in versioned code directories, so that the live code directory is not overwritten. This process allows Puppet operations to continue during code deployments.
If you do not require lockless code deploys, set the value to
false
.Enabling lockless code deploys will help to minimize disruptions associated with upgrading to future PE versions in which the feature will be enabled by default.
- Set
- Click Commit.
- Run Puppet on your primary server and all
compilers.Potential errors:
If you use Run Puppet in the console to trigger the Puppet run, the job, on the Jobs page, appears to fail due to underlying services being restarted. This error is not fatal and the Reports page shows the actual, successful result.
Additionally, if you run Puppet on your primary server and all compilers at the same time, the compilers' logs might report these errors:
2015-11-20 08:14:38,308 ERROR [clojure-agent-send-off-pool-0] [p.e.s.f.file-sync-client-core] File sync failure: Unable to get latest-commits from server (https://primary.example.com:8140/file-sync/v1/latest-commits). java.net.ConnectException: Connection refused
These errors occur when Puppet Server is restarting when the compilers poll for new code, and they usually stop when Puppet Server finishes restarting on the primary server. You can ignore these errors while the primary server starts.
Set up authentication for Code Manager.