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
To automatically manage your environments and modules, Code Manager uses r10k and the file sync service to stage, commit, and sync your code. -
Set up Code Manager
You must set up Code Manager to use it 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 deploying 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
Set parameters in Hiera to customize your Code Manager configuration. -
Triggering Code Manager on the command line
Use thepuppet-code
command to trigger Code Manager from the command line and 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. Webhooks are the simplest way to trigger Code Manager. -
Triggering Code Manager with custom scripts
Custom scripts are a good way to trigger deployments if you can't use webhooks. For example, if you have privately hosted Git repositories, custom notifications, or existing continuous integration systems (like Continuous Delivery for Puppet Enterprise (PE)). -
Troubleshooting Code Manager
Code Manager requires coordination between multiple components, including source control, r10k, and the file sync service. If you have issues with Code Manager, check that these components are functioning. -
Code Manager API
You can use the Code Manager API to deploy code and check the status of deployments on your primary server and compilers without direct shell access. -
About file sync
File sync helps Code Manager keep your Puppet code synchronized across your primary server and compilers.