Skip to content

Instantly share code, notes, and snippets.

@Magisus
Last active March 21, 2022 22:48
Show Gist options
  • Save Magisus/535b4954c236d910028e29ec3f428329 to your computer and use it in GitHub Desktop.
Save Magisus/535b4954c236d910028e29ec3f428329 to your computer and use it in GitHub Desktop.
Enable Code Manager
Steps to enable Code Manager on a VMPooler node
1. Install PE
2. Generate an SSH key to use with Github and add it to your Github
3. Control repo: https://github.com/Magisus/control-repo -> git@github.com:Magisus/control-repo.git
4. Set params of puppet_enterprise::profile::master:
- code_manager_auto_configure: true
- r10k_remote: git@github.com:Magisus/control-repo.git
- r10k_private_key: point at key created above, e.g. "/etc/puppetlabs/puppetserver/ssh/id_rsa-control"
5. Run puppet agent
6. Run `puppet access login --lifetime 12h` to generate an RBAC token for use with `puppet code`
7. Run `puppet code deploy --all --wait` to test setup
API:
curl -k -X POST -H 'Content-Type: application/json' -H "X-Authentication: `puppet access show`" "https://YOUR-VM.delivery.puppetlabs.net:8170/code-manager/v1/deploys" -d '{"environments": ["production"], "wait": true}'
Deploy a project:
curl -k -X POST -H 'Content-Type: application/json' -H "X-Authentication: `puppet access show`" "https://YOUR-VM.delivery.puppetlabs.net:8170/code-manager/v1/projects/deploy" -d @project.json
project.json:
{"project-id":"my_project","remote":"https://github.com/Magisus/a_project","ref":"43094e0eb9ba14814a5fbe597c6bee2b681a0810","wait":true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment