In order to complete the change I refactered the webhook into its own set of profiles, one with mcollective and the other without.
5.9 KiB
Before Starting:
This control repo and the steps below are intended to be used during a new installation of PE.
If you intend to use it on an existing installation of PE then you'll have to figure out some of the steps on your own and be warned that if you've already written or downloaded modules when you start using r10k it will remove all of the existing modules and replace them with what you define in your Puppetfile. Please copy or move your existing modules to another directory to ensure you do not lose any work you've already started.
Setup a Trusted Fact On Your PE Master
This control repository is setup to manage certain portions of your PE installation for you if you create a trusted fact called pp_role
. In order to do so, lay down a file that looks exactly like the below in /etc/puppetlabs/puppet/csr_attributes.yaml
---
extension_requests:
#pp_role
1.3.6.1.4.1.34380.1.1.13: 'all_in_one_pe'
If You Have Not Installed PE
Good then you can proceed forward and the trusted fact will be used when you get to the install step.
If You Have Already Installed PE
Trusted facts are created at the time a CSR is generated. So, we need to regenerate the certificate on the master for the above trusted fact to be created.
Follow this document to regenerate the certificate on your master.
http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html
##Copy This Repo Into Your Own Git Server
###Gitlab
- Install Gitlab
-
After Gitlab is installed you may sign if with the
root
user and password5iveL!fe
-
Make an user for yourself
-
Make an ssh key to link with your user. You’ll want to do this on the machine you intend to edit code from ( most likely not your puppet master but your local workstation / laptop )
- Create a group called
puppet
( this is case sensitive )
- Create a user called
r10k_api_user
and add them to thepuppet
group
- From the landing page, select groups
- Choose the puppet group
- In the left hand pane, select memembers
- Add the
r10k_api_user
withmaster
permissions
-
Add your user to the
puppet
group as well -
Create a project called
control-repo
and set the Namespace to be thepuppet
group -
Logout of root and login as the
r10k_api_user
- Go to profile settings -> account ( https://<your_gitlab_server>/profile/account )
- Copy the api token
- Clone this control repository to your laptop/workstation
git clone https://github.com/npwalker/control-repo.git
cd control-repo
git mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/<fqdn_of_your_puppet_master>.yaml
- Open
hieradata/nodes/<fqdn_of_your_puppet_master>.yaml
- edit
gms_api_token
to be your api token - edit
git_management_system
to be 'gitlab' - edit the
gms_server_url
- edit
-
git commit -m "renaming example-puppet-master.yaml"
-
Rename my repository as the upstream remote
git remote rename origin upstream
- Add your internal repository as the origin remote
git remote add origin <url of your repository from step 4>
- Push the production branch of the repository from your machine up to your git server
git push origin production
###Stash
###Github
###The General Idea - Not Specific to GMS
-
Make an user in your internal git server for yourself
-
Make an ssh key to link with your user. You’ll want to do this on the machine you intend to edit code from ( most likely not your puppet master but your local workstation / laptop )
-
Create a group or organization called "puppet"
-
Create a repository in your git server called control-repo
-
Clone this control repository to your laptop/workstation
git clone https://github.com/npwalker/control-repo.git
cd control-repo
- Rename my repository as the upstream remote
git remote rename origin upstream
- Add your internal repository as the origin remote
git remote add origin <url of your repository from step 4>
- Push the production branch of the repository from your machine up to your git server
git push origin production
-
Find the url to your internal repo this is usually on the front page of the repo
-
Add the repo as a remote
- git remote add origin git@your-git-server:puppet/control-repo.git
- Push the repository from your machine up to your git server
- git push origin production
##Configure PE to Use the Control-Repo
###Install PE
- Download the latest version of the PE installer for your platform and copy it to your master
- Expand the tarball and
cd
into the directory - Run
puppet-enterprise-installer
to install
If you run into any issues or have more questions about the installer you can see our docs here:
http://docs.puppetlabs.com/pe/latest/install_basic.html
Update Your Existing Install To Point To The Control Repository
https://docs.puppetlabs.com/pe/latest/r10k_config_console.html
Run r10k
- Run
r10k deploy environment -pv
and watch it install the modules from your Puppetfile
#Miscellaneous
If You Want to Install Pointing To This Repo on Github
Setting Up Gitlab
- Install Gitlab on a server by specifying the following trusted fact on the soon-to-be Gitlab server and then install the PE agent.
---
extension_requests:
#pp_role
1.3.6.1.4.1.34380.1.1.13: 'gitlab'
Setting up Github
Not yet completed.
Setting up Stash
Not yet completed.
#TODO Flush out generating an answer file and then appending extra answers onto the end of it.