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.

  • Configure Code Manager concurrency

    Enable Code Manager in Puppet Enterprise (PE), and then use the variables to configure Code Manager concurrency.

  • Lockless code deploys

    The lockless code deploys feature within Code Manager allows deployment of Puppet code without interrupting other Puppet operations. When this feature is disabled, requests to Puppet Server are blocked during code deployments until the file sync client has finished updating the live Puppet code directory, However, when lockless code deploys are enabled, the file sync client saves newly deployed code into versioned directories, ensuring that the live code directory is not overwritten. This process allows Puppet operations to continue without interruption during code deployments.

  • Customize Code Manager configuration in Hiera

    Set parameters in Hiera to customize your Code Manager configuration.

  • Triggering Code Manager on the command line

    Use the puppet-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).

  • 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.