Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet > 4.3.2
- , , , , ,
Tasks:
- pe_code_manager_easy_setup
Start using this module
Add this module to your Puppetfile:
mod 'beersy-pe_code_manager_easy_setup', '2.0.3'
Learn more about managing modules with a PuppetfileDocumentation
Table of Contents
- Description
- Setup - The basics of getting started with pe_code_manager_easy_setup
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
This module and task makes it easy to install code manager.
Task
Using the task is highly recommended if you are running PE 2017.3 or are using Bolt. It is much simpler than using the module.
Usage
First, install this module by running these command on the master as root:
puppet module install beersy-pe_code_manager_easy_setup
Set r10k_remote_url
to git url of control repo (default: git@gitlab:puppet/control-repo.git). Both ssh and https url's are accepted. Ex:
If something goes wrong, check the /tmp/ez*.log's for more information. The task will fail if it is run on a node that is not a master.
After you run the task, check the output for the public ssh key and webhook url. You will need to manually put them in your version control system.
NOTE The task can take a few minutes to run.
You can also run the Puppet Task from the command line using:
puppet access login <pe_console_user>
puppet task run pe_code_manager_easy_setup::setup_code_manager r10k_remote_url=<repo> -n <master_certname>
Or using bolt:
bolt task run pe_code_manager_easy_setup::setup_code_manager r10k_remote_url=<repo> --modulepath /etc/puppetlabs/code/environments/production/modules --nodes <master_certname>
Once the task has completed follow the Post-Install Steps.
Module Setup
You can ignore these steps if you are using the task.
What pe_code_manager_easy_setup affects
This module will:
- create the appropriate RBAC users for code manager
- configure the PE Master node group for code manager
- generate the deployment key to be placed into github/gitlab
- generate the webhook URL to placed into github/gitlab
Setup Requirements
This module assumes gem, git, and Puppet Enterprise are already installed.
Usage
Install this module by running these command on the master as root:
puppet module install beersy-pe_code_manager_easy_setup
puppet resource package puppetclassify ensure=present provider=puppet_gem
puppet apply -e "class { 'pe_code_manager_easy_setup': r10k_remote_url => 'GIT_REPO_URL', git_management_system => 'GMS'}"
Run the above puppet apply
command again.
Run puppet agent -t
Replace these values before running:
- GIT_REPO_URL: set to git url of control repo (default: git@gitlab:puppet/control-repo.git)
- GMS: set to 'gitlab' or 'github' (default:'gitlab')
Post-Install steps
If successful, this module generates 2 files on the master:
1 /etc/puppetlabs/puppetserver/ssh/id-control_repo.rsa.pub
Paste the contents of file as a deploy key:
Gitlab:
http://PATH_TO_CONTROL_REPO/deploy_keys (ex: http://gitlab/puppet/control-repo/deploy_keys)
Github:
https://PATH_TO_CONTROL_REPO/settings/keys
(ex: https://github.com/puppetlabs/control-repo/settings/keys)
2 /etc/puppetlabs/puppetserver/.puppetlabs/webhook_url.txt
Gitlab instructions:
- Go to: http://PATH_TO_CONTROL_REPO/hooks
- URL: URL from webhook_url.txt
- Trigger: Enable "Push events"
- SSL verification: Enable "Enable SSL verification"
Github instructions:
- Go to: https://PATH_TO_CONTROL_REPO/settings/hooks/new
- Payload URL: URL from webhook_url.txt
- Content type: "application/json"
- Which events would you like to trigger this webhook?:"Just the push event."
Limitations
This modules assumes that you are running:
- Puppet Enterprise 2015.3 or higher
- Gitlab 8.5 or higher
- gem, git are already installed
Release Notes/Contributors/Etc.
2.0.2 - Minor bug fixes and documentation updates.
2.0.1 - Fixed bug related to access token, and improved execution time.
2.0.0 - Added task
1.0.1 - Changed to adhere to pdk standards. Added tests
1.0.0 - Initial release
0.1.4 - Removing unnecessary puppet_gem dependency
0.1.3 - Typo fix
0.1.2 - Readme fix
0.1.1 - Code cleanup, added readme and other docs
0.1.0 - Initial Release
What are tasks?
Modules can contain tasks that take action outside of a desired state managed by Puppet. It’s perfect for troubleshooting or deploying one-off changes, distributing scripts to run across your infrastructure, or automating changes that need to happen in a particular order as part of an application deployment.
Tasks in this module release
Dependencies
- npwalker-pe_code_manager_webhook (2.0.1)
- geoffwilliams-chown_r (0.2.0)
- WhatsARanjit-node_manager (0.3.1)
- puppetlabs-stdlib (>= 4.1.0 < 5.0.0)
- pltraining-rbac (>= 0.0.5 < 0.0.6)
- abrader-gms (>= 1.0.2 < 2.0.0)