Managing code with Code Manager
Code Manager automates the management and deployment of your Puppet code. When you push code updates to your source control repository, Code Manager syncs the code to your primary server and compilers. This allows all your servers to run the new code as soon as possible, without interrupting in-progress agent runs.
-
How Code Manager works
Code Manager uses r10k and the file sync service to stage, commit, and sync your code, automatically managing your environments and modules. -
Set up Code Manager
Set up Code Manager as your code management tool. -
Configure Code Manager
To configure Code Manager you must enable Code Manager in Puppet Enterprise (PE), set up authentication, and test the connection between the control repository and Code Manager. -
Lockless code deploys
When compiling code, Puppet Server blocks requests, including catalog compilation, until file sync is done updating the Puppet code directory. However, you can enable lockless code deploys to deploy code without blocking requests to Puppet Server. With lockless code deploys, the file sync client updates code into versioned code directories instead of blocking requests and overwriting the live code directory. -
Customize Code Manager configuration in Hiera
To customize your Code Manager configuration, set parameters with Hiera. -
Triggering Code Manager on the command line
Thepuppet-code
command allows you to trigger Code Manager from the command line to deploy your environments. -
Triggering Code Manager with a webhook
To deploy your code, you can trigger Code Manager by hitting a web endpoint, either through a webhook or a custom script. The webhook is the simplest way to trigger Code Manager. -
Triggering Code Manager with custom scripts
Custom scripts are a good way to trigger deployments if you have requirements such as existing continuous integration systems, privately hosted Git repositories, or custom notifications. -
Troubleshooting Code Manager
Code Manager requires coordination between multiple components, including r10k and the file sync service. If you have issues with Code Manager, check that these components are functioning. -
Code Manager API
Use Code Manager endpoints to deploy code and query environment deployment status on your primary server and compilers without direct shell access.