From a6ef3842225e303fc673fdb13b595b36d961e721 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 13 Jan 2015 16:50:53 -0800 Subject: Add the README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..5ab2dc9 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +1. Clone this repo down to your master (in /tmp is fine) and upload it to your own internal git server +2. Edit configure_r10k.pp so that the server parameter is set to your interal git server and repo name +3. On your Master, run `puppet apply configure_r10k.pp` + - This will install r10k and point it at the repo we setup in step 1 +4. You can remove configure_r10k.pp from the repo now. + -- cgit v1.2.3 From 0c67040afa385c7894326bf8c50452f4f06c39cd Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Wed, 14 Jan 2015 14:32:59 -0800 Subject: Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 5ab2dc9..c913915 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ 1. Clone this repo down to your master (in /tmp is fine) and upload it to your own internal git server 2. Edit configure_r10k.pp so that the server parameter is set to your interal git server and repo name -3. On your Master, run `puppet apply configure_r10k.pp` +3. On your Master, run `puppet module install zack/r10k` +4. On your Master, run `puppet apply configure_r10k.pp` - This will install r10k and point it at the repo we setup in step 1 4. You can remove configure_r10k.pp from the repo now. -- cgit v1.2.3 From e2b5da17e68bf8ef0c378d3c5029d3e1a56fb870 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Wed, 14 Jan 2015 17:17:58 -0800 Subject: Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index c913915..c6ef672 100644 --- a/README.md +++ b/README.md @@ -3,5 +3,7 @@ 3. On your Master, run `puppet module install zack/r10k` 4. On your Master, run `puppet apply configure_r10k.pp` - This will install r10k and point it at the repo we setup in step 1 -4. You can remove configure_r10k.pp from the repo now. +5. You're now ready to run `r10k deploy environment --verbose` which will deploy modules from your Puppetfile + +Side note: You can remove configure_r10k.pp from the repo now. -- cgit v1.2.3 From 724e3e97d0d1fec8d1c07f5109cb77d59e5d9199 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Fri, 15 May 2015 12:05:33 -0700 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index c6ef672..370cb64 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ 3. On your Master, run `puppet module install zack/r10k` 4. On your Master, run `puppet apply configure_r10k.pp` - This will install r10k and point it at the repo we setup in step 1 -5. You're now ready to run `r10k deploy environment --verbose` which will deploy modules from your Puppetfile +5. You're now ready to run `r10k deploy environment -p --verbose` which will deploy modules from your Puppetfile Side note: You can remove configure_r10k.pp from the repo now. -- cgit v1.2.3 From bfed08bfea898480e517985250f561ed8557609d Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 26 May 2015 10:00:02 -0700 Subject: Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 370cb64..011b779 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +# Before Starting: + +If you've already written or download 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. + +## How to Use This Repo + 1. Clone this repo down to your master (in /tmp is fine) and upload it to your own internal git server 2. Edit configure_r10k.pp so that the server parameter is set to your interal git server and repo name 3. On your Master, run `puppet module install zack/r10k` -- cgit v1.2.3 From 9b50d5e31ee4de65445b6a5bec39da590dedbe36 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Thu, 13 Aug 2015 14:10:29 -0700 Subject: Update the README, add an all_in_one_pe role Updating README for instructions on how to use the control-repo by putting it in your own git server and then using the r10k answers during installation of PE. Removing the manifest for configuring r10k using zack/r10k. Added a role that can be used to bootstrap an all-in-one PE installation. --- README.md | 64 +++++++++++++++++++++++++++++++----- configure_r10k.pp | 19 ----------- site/role/manifests/all_in_one_pe.pp | 5 +++ 3 files changed, 60 insertions(+), 28 deletions(-) delete mode 100644 configure_r10k.pp create mode 100644 site/role/manifests/all_in_one_pe.pp (limited to 'README.md') diff --git a/README.md b/README.md index 011b779..7877c02 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,61 @@ # Before Starting: -If you've already written or download 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. +This control repo and the steps below are intended to be used during a new installation of PE. -## How to Use This Repo +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. -1. Clone this repo down to your master (in /tmp is fine) and upload it to your own internal git server -2. Edit configure_r10k.pp so that the server parameter is set to your interal git server and repo name -3. On your Master, run `puppet module install zack/r10k` -4. On your Master, run `puppet apply configure_r10k.pp` - - This will install r10k and point it at the repo we setup in step 1 -5. You're now ready to run `r10k deploy environment -p --verbose` which will deploy modules from your Puppetfile +## How to Copy This Repo Into Your Own Git Server + +1. Make an user in your internal git server + +2. 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 ) + - https://help.github.com/articles/generating-ssh-keys/ + +3. Create a repository in your git server called control-repo + +4. Setup your control repository by copying this one + - https://github.com/npwalker/control-repo + - git clone https://github.com/npwalker/control-repo.git + +5. Remove the .git directory from the cloned repo. + - `cd control-repo` + - `rm -rf .git` + +6. `git init` + +7. 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@gitlab-server:root/control-repo.git + +8. Push the repository from your machine up to your git server + - `git push origin production` + +## Lay Down a Trusted Fact Before Installing PE + +This control repository is setup to manage certain portions of your PE installation for you if you lay down a trusted fact called pp_role before installing. In order to immeadiately gain from these benefits you will need to 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' +``` + +## Install a New PE 2015.2+ Instance or Update an Existing PE Instance To Use the Control Repository + +### Install PE Specifying Answers To Point To Your Control Repository + +https://docs.puppetlabs.com/pe/latest/r10k_config_answers.html + +#TODO +Flush out generating an answer file and then appending these answers onto the end of it. + +### Update Existing PE 2015.2+ Install To Point To The Control Repository + +https://docs.puppetlabs.com/pe/latest/r10k_config_console.html + +## Run r10k + +1. Run `r10k deploy environment —verbose` and watch it install the modules from your Puppetfile -Side note: You can remove configure_r10k.pp from the repo now. diff --git a/configure_r10k.pp b/configure_r10k.pp deleted file mode 100644 index fe52a1b..0000000 --- a/configure_r10k.pp +++ /dev/null @@ -1,19 +0,0 @@ -###### ###### -## Configure R10k ## -###### ###### - -## This manifest requires the zack/R10k module -## Beware! (and good luck!) - -class { 'r10k': - version => '1.5.1', - sources => { - 'puppet' => { - #Edit remote to be your own control_repo - 'remote' => 'https://github.com/npwalker/control-repo.git', - 'basedir' => "${::settings::confdir}/environments", - 'prefix' => false, - } - }, - manage_modulepath => false, -} diff --git a/site/role/manifests/all_in_one_pe.pp b/site/role/manifests/all_in_one_pe.pp new file mode 100644 index 0000000..ca99139 --- /dev/null +++ b/site/role/manifests/all_in_one_pe.pp @@ -0,0 +1,5 @@ +class role::all_in_one_pe { + + include profile::puppetmaster + +} -- cgit v1.2.3 From 1eab000f1fdaa9deca07507dfcf6b571760f7a13 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 18 Aug 2015 14:03:08 -0700 Subject: Update the README with more specific instructions This is still a WIP --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 7877c02..fb27fac 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,32 @@ If you intend to use it on an existing installation of PE then you'll have to fi 8. Push the repository from your machine up to your git server - `git push origin production` +## Setting Up Your Git Management System + +### Setting Up Gitlab + +1. Install Gitlab on a server by specifying laying down the following trusted fact + +2. After Gitlab is installed you may sign if with the `root` user and password `5iveL!fe` + +3. Create a group called `puppet` ( notice the lower case p ) + - http://doc.gitlab.com/ce/workflow/groups.html + +4. Create a user called `r10k_api_user` and add them to the `puppet` group + +5. Create a project called `control-repo` and set the Namespace to be the `puppet` group + - If you have direct internet access from your Gitlab server you can also use the "Import project from" option to import this repo + - If you do not have direct internet access then wait a little bit and we'll get to that later + +6. Login as the `r10k_api_user` + - Go to profile settings -> account ( https:///profile/account ) + - Copy the api token + +7. `mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/.yaml` + - Open `hieradata/nodes/.yaml` and edit `gms_api_token` to be your api token + +8. + ## Lay Down a Trusted Fact Before Installing PE This control repository is setup to manage certain portions of your PE installation for you if you lay down a trusted fact called pp_role before installing. In order to immeadiately gain from these benefits you will need to lay down a file that looks exactly like the below in `/etc/puppetlabs/puppet/csr_attributes.yaml` -- cgit v1.2.3 From 4e555b20e0afe8b391970430b63b54e810adc484 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 18 Aug 2015 16:09:53 -0700 Subject: Update README --- README.md | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index fb27fac..e0e0950 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,20 @@ If you intend to use it on an existing installation of PE then you'll have to fi ### Setting Up Gitlab -1. Install Gitlab on a server by specifying laying down the following trusted fact +1. Install Gitlab on a server by specifying laying down the following trusted fact the soon-to-be Gitlab server and then [install the PE agent](http://docs.puppetlabs.com/pe/latest/install_agents.html#using-the-puppet-agent-package-installation-script). -2. After Gitlab is installed you may sign if with the `root` user and password `5iveL!fe` + ``` + --- + extension_requests: + #pp_role + 1.3.6.1.4.1.34380.1.1.13: 'gitlab' + ``` + +2. After the install of the agent completes and an agent run completes Gitlab will be installed. -3. Create a group called `puppet` ( notice the lower case p ) +2. After Gitlab is installed you may sign if with the `root` user and password `5iveL!fe` + +3. Create a group called `puppet` ( this is case sensitive ) - http://doc.gitlab.com/ce/workflow/groups.html 4. Create a user called `r10k_api_user` and add them to the `puppet` group @@ -47,18 +56,24 @@ If you intend to use it on an existing installation of PE then you'll have to fi - If you have direct internet access from your Gitlab server you can also use the "Import project from" option to import this repo - If you do not have direct internet access then wait a little bit and we'll get to that later -6. Login as the `r10k_api_user` +6. Logout of root and login as the `r10k_api_user` - Go to profile settings -> account ( https:///profile/account ) - Copy the api token 7. `mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/.yaml` - - Open `hieradata/nodes/.yaml` and edit `gms_api_token` to be your api token + - Open `hieradata/nodes/.yaml` + - edit `gms_api_token` to be your api token + - edit `git_management_system` to be 'gitlab' + - You should not need to edit the `gms_server_url` + + +### Setting up Github -8. +You ## Lay Down a Trusted Fact Before Installing PE -This control repository is setup to manage certain portions of your PE installation for you if you lay down a trusted fact called pp_role before installing. In order to immeadiately gain from these benefits you will need to lay down a file that looks exactly like the below in `/etc/puppetlabs/puppet/csr_attributes.yaml` +This control repository is setup to manage certain portions of your PE installation for you if you lay down a trusted fact called `pp_role` before installing. In order to immeadiately gain from these benefits you will need to lay down a file that looks exactly like the below in `/etc/puppetlabs/puppet/csr_attributes.yaml` ``` --- @@ -84,4 +99,3 @@ https://docs.puppetlabs.com/pe/latest/r10k_config_console.html 1. Run `r10k deploy environment —verbose` and watch it install the modules from your Puppetfile - -- cgit v1.2.3 From fe07a8553031dd7f0d501616754d568630dfca04 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 22 Sep 2015 13:39:39 -0700 Subject: Update README partially I made some updates to the README that I never committed. I'm probably going to change some of this but it's more useful with these additions than without. --- README.md | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index e0e0950..8d63619 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,41 @@ This control repo and the steps below are intended to be used during a new insta 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. +## Lay Down a Trusted Fact Before Installing PE + +This control repository is setup to manage certain portions of your PE installation for you if you lay down a trusted fact called `pp_role` before installing. In order to immeadiately gain from these benefits you will need to 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' +``` + +##Install PE 2015.2 + +1. Download the 2015.2 installer for your platform and copy it to your master + - https://puppetlabs.com/download-puppet-enterprise-expand +2. Expand the tarball and `cd` into the directory +3. Run `puppet-enterprise-installer` to install + + ## How to Copy This Repo Into Your Own Git Server -1. Make an user in your internal git server +1. Make an user in your internal git server for yourself 2. 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 ) - https://help.github.com/articles/generating-ssh-keys/ -3. Create a repository in your git server called control-repo +3. Create a group or organization called "puppet" -4. Setup your control repository by copying this one +4. Create a repository in your git server called control-repo + +4. Upload this control repository to your control repository - https://github.com/npwalker/control-repo - - git clone https://github.com/npwalker/control-repo.git + - git clone --mirror https://github.com/npwalker/control-repo.git + - cd control-repo + - git remote set-url --push 5. Remove the .git directory from the cloned repo. - `cd control-repo` @@ -30,6 +53,10 @@ If you intend to use it on an existing installation of PE then you'll have to fi 8. Push the repository from your machine up to your git server - `git push origin production` +## Update Your Install To Point To The Control Repository + +https://docs.puppetlabs.com/pe/latest/r10k_config_console.html + ## Setting Up Your Git Management System ### Setting Up Gitlab @@ -69,18 +96,12 @@ If you intend to use it on an existing installation of PE then you'll have to fi ### Setting up Github -You +Not yet completed. -## Lay Down a Trusted Fact Before Installing PE +### Setting up Stash -This control repository is setup to manage certain portions of your PE installation for you if you lay down a trusted fact called `pp_role` before installing. In order to immeadiately gain from these benefits you will need to lay down a file that looks exactly like the below in `/etc/puppetlabs/puppet/csr_attributes.yaml` +Not yet completed. -``` ---- -extension_requests: - #pp_role - 1.3.6.1.4.1.34380.1.1.13: 'all_in_one_pe' -``` ## Install a New PE 2015.2+ Instance or Update an Existing PE Instance To Use the Control Repository @@ -91,9 +112,7 @@ https://docs.puppetlabs.com/pe/latest/r10k_config_answers.html #TODO Flush out generating an answer file and then appending these answers onto the end of it. -### Update Existing PE 2015.2+ Install To Point To The Control Repository -https://docs.puppetlabs.com/pe/latest/r10k_config_console.html ## Run r10k -- cgit v1.2.3 From 03d6c0c74c113732c9e7f64c93209793f8b1262b Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Thu, 24 Sep 2015 16:03:26 -0700 Subject: Update README some more --- README.md | 172 ++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 110 insertions(+), 62 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 8d63619..b98026a 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ This control repo and the steps below are intended to be used during a new insta 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. -## Lay Down a Trusted Fact Before Installing PE +## 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 lay down a trusted fact called `pp_role` before installing. In order to immeadiately gain from these benefits you will need to lay down a file that looks exactly like the below in `/etc/puppetlabs/puppet/csr_attributes.yaml` +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` ``` --- @@ -15,106 +15,154 @@ extension_requests: 1.3.6.1.4.1.34380.1.1.13: 'all_in_one_pe' ``` -##Install PE 2015.2 +### If You Have Not Installed PE -1. Download the 2015.2 installer for your platform and copy it to your master - - https://puppetlabs.com/download-puppet-enterprise-expand -2. Expand the tarball and `cd` into the directory -3. Run `puppet-enterprise-installer` to install +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 -## How to Copy This Repo Into Your Own Git Server +##Copy This Repo Into Your Own Git Server + +###Gitlab + +1. Install Gitlab + - https://about.gitlab.com/downloads/ + +2. After Gitlab is installed you may sign if with the `root` user and password `5iveL!fe` -1. Make an user in your internal git server for yourself +3. Make an user for yourself -2. 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 ) +4. 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 ) + - http://doc.gitlab.com/ce/ssh/README.html - https://help.github.com/articles/generating-ssh-keys/ -3. Create a group or organization called "puppet" +5. Create a group called `puppet` ( this is case sensitive ) + - http://doc.gitlab.com/ce/workflow/groups.html -4. Create a repository in your git server called control-repo +6. Create a user called `r10k_api_user` and add them to the `puppet` group + +7. Add your user to the `puppet` group as well -4. Upload this control repository to your control repository - - https://github.com/npwalker/control-repo - - git clone --mirror https://github.com/npwalker/control-repo.git - - cd control-repo - - git remote set-url --push +7. Create a project called `control-repo` and set the Namespace to be the `puppet` group + - TODO: Change permissions on the group? -5. Remove the .git directory from the cloned repo. +8. Logout of root and login as the `r10k_api_user` + - Go to profile settings -> account ( https:///profile/account ) + - Copy the api token + - TODO: Change permissions for this user? + +9. Clone this control repository to your laptop/workstation + - `git clone --mirror https://github.com/npwalker/control-repo.git` - `cd control-repo` - - `rm -rf .git` -6. `git init` +10. `mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/.yaml` + - Open `hieradata/nodes/.yaml` + - edit `gms_api_token` to be your api token + - edit `git_management_system` to be 'gitlab' + - You should not need to edit the `gms_server_url` + +11. Rename my repository as the upstream remote + - `git remote rename origin upstream` -7. 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@gitlab-server:root/control-repo.git +12. Add your internal repository as the origin remote + - `git remote add origin ` -8. Push the repository from your machine up to your git server +13. Push the production branch of the repository from your machine up to your git server - `git push origin production` -## Update Your Install To Point To The Control Repository +###Stash -https://docs.puppetlabs.com/pe/latest/r10k_config_console.html +###Github -## Setting Up Your Git Management System +###The General Idea - Not Specific to GMS -### Setting Up Gitlab +1. Make an user in your internal git server for yourself -1. Install Gitlab on a server by specifying laying down the following trusted fact the soon-to-be Gitlab server and then [install the PE agent](http://docs.puppetlabs.com/pe/latest/install_agents.html#using-the-puppet-agent-package-installation-script). +2. 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 ) - ``` - --- - extension_requests: - #pp_role - 1.3.6.1.4.1.34380.1.1.13: 'gitlab' - ``` - -2. After the install of the agent completes and an agent run completes Gitlab will be installed. + - https://help.github.com/articles/generating-ssh-keys/ -2. After Gitlab is installed you may sign if with the `root` user and password `5iveL!fe` +3. Create a group or organization called "puppet" -3. Create a group called `puppet` ( this is case sensitive ) - - http://doc.gitlab.com/ce/workflow/groups.html +4. Create a repository in your git server called control-repo -4. Create a user called `r10k_api_user` and add them to the `puppet` group +4. Clone this control repository to your laptop/workstation + - `git clone https://github.com/npwalker/control-repo.git` + - `cd control-repo` -5. Create a project called `control-repo` and set the Namespace to be the `puppet` group - - If you have direct internet access from your Gitlab server you can also use the "Import project from" option to import this repo - - If you do not have direct internet access then wait a little bit and we'll get to that later +5. Rename my repository as the upstream remote + - `git remote rename origin upstream` -6. Logout of root and login as the `r10k_api_user` - - Go to profile settings -> account ( https:///profile/account ) - - Copy the api token +6. Add your internal repository as the origin remote + - `git remote add origin ` -7. `mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/.yaml` - - Open `hieradata/nodes/.yaml` - - edit `gms_api_token` to be your api token - - edit `git_management_system` to be 'gitlab' - - You should not need to edit the `gms_server_url` - +7. Push the production branch of the repository from your machine up to your git server + - `git push origin production` -### Setting up Github +8. Find the url to your internal repo this is usually on the front page of the repo -Not yet completed. +9. Add the repo as a remote + - git remote add origin git@your-git-server:puppet/control-repo.git -### Setting up Stash +10. Push the repository from your machine up to your git server -Not yet completed. + - git push origin production +##Configure PE to Use the Control-Repo -## Install a New PE 2015.2+ Instance or Update an Existing PE Instance To Use the Control Repository +###Install PE -### Install PE Specifying Answers To Point To Your Control Repository +1. Download the latest version of the PE installer for your platform and copy it to your master + - https://puppetlabs.com/download-puppet-enterprise +2. Expand the tarball and `cd` into the directory +3. Run `puppet-enterprise-installer` to install -https://docs.puppetlabs.com/pe/latest/r10k_config_answers.html +If you run into any issues or have more questions about the installer you can see our docs here: -#TODO -Flush out generating an answer file and then appending these answers onto the end of it. +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 1. Run `r10k deploy environment —verbose` and watch it install the modules from your Puppetfile + +---- +#Miscellaneous + +## If You Want to Install Pointing To This Repo on Github + +### Setting Up Gitlab + +1. Install Gitlab on a server by specifying the following trusted fact on the soon-to-be Gitlab server and then [install the PE agent](http://docs.puppetlabs.com/pe/latest/install_agents.html#using-the-puppet-agent-package-installation-script). + + ``` + --- + 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. + + + -- cgit v1.2.3 From c54b9000ead6ad616604ea7182a7b3a9189304cb Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Fri, 25 Sep 2015 08:33:08 -0700 Subject: Update README to remove --mirror from git clone --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index b98026a..3461e35 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html - TODO: Change permissions for this user? 9. Clone this control repository to your laptop/workstation - - `git clone --mirror https://github.com/npwalker/control-repo.git` + - `git clone https://github.com/npwalker/control-repo.git` - `cd control-repo` 10. `mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/.yaml` -- cgit v1.2.3 From a8cbec54e0efb9f3baaa5824a7fe664014de900c Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 29 Sep 2015 11:09:54 -0700 Subject: update README --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 3461e35..97d5795 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,13 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html - `git clone https://github.com/npwalker/control-repo.git` - `cd control-repo` -10. `mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/.yaml` +10. `git mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/.yaml` - Open `hieradata/nodes/.yaml` - edit `gms_api_token` to be your api token - edit `git_management_system` to be 'gitlab' - - You should not need to edit the `gms_server_url` + - edit the `gms_server_url` + +11. `git commit -m "renaming example-puppet-master.yaml"` 11. Rename my repository as the upstream remote - `git remote rename origin upstream` @@ -133,7 +135,7 @@ https://docs.puppetlabs.com/pe/latest/r10k_config_console.html ## Run r10k -1. Run `r10k deploy environment —verbose` and watch it install the modules from your Puppetfile +1. Run `r10k deploy environment -pv` and watch it install the modules from your Puppetfile ---- -- cgit v1.2.3 From 1828e2162304d7d9a2e26743f175d76256b6e0c1 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Fri, 16 Oct 2015 10:53:16 -0700 Subject: Change to using the webhook without mcollective In order to complete the change I refactered the webhook into its own set of profiles, one with mcollective and the other without. --- README.md | 6 ++++-- site/profile/manifests/puppetmaster.pp | 13 ------------- site/profile/manifests/webhook_mcollective.pp | 15 +++++++++++++++ site/profile/manifests/webhook_no_mcollective.pp | 13 +++++++++++++ site/role/manifests/all_in_one_pe.pp | 1 + 5 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 site/profile/manifests/webhook_mcollective.pp create mode 100644 site/profile/manifests/webhook_no_mcollective.pp (limited to 'README.md') diff --git a/README.md b/README.md index 97d5795..2125c09 100644 --- a/README.md +++ b/README.md @@ -46,16 +46,18 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html - http://doc.gitlab.com/ce/workflow/groups.html 6. Create a user called `r10k_api_user` and add them to the `puppet` group + - From the landing page, select groups + - Choose the puppet group + - In the left hand pane, select memembers + - Add the `r10k_api_user` with `master` permissions 7. Add your user to the `puppet` group as well 7. Create a project called `control-repo` and set the Namespace to be the `puppet` group - - TODO: Change permissions on the group? 8. Logout of root and login as the `r10k_api_user` - Go to profile settings -> account ( https:///profile/account ) - Copy the api token - - TODO: Change permissions for this user? 9. Clone this control repository to your laptop/workstation - `git clone https://github.com/npwalker/control-repo.git` diff --git a/site/profile/manifests/puppetmaster.pp b/site/profile/manifests/puppetmaster.pp index 4fc06f2..bc52d3b 100644 --- a/site/profile/manifests/puppetmaster.pp +++ b/site/profile/manifests/puppetmaster.pp @@ -12,19 +12,6 @@ class profile::puppetmaster { group => 'root', notify => Service['pe-puppetserver'], } - - ##BEGIN - r10k webhook support - include r10k::mcollective - - include r10k::webhook::config - - class {'r10k::webhook': - user => 'root', - group => '0', - require => Class['r10k::webhook::config'], - notify => Service['mcollective'], - } - ##END - r10k webhook support #BEGIN - Generate an SSH key for r10k to connect to git $r10k_ssh_key_file = '/root/.ssh/r10k_rsa' diff --git a/site/profile/manifests/webhook_mcollective.pp b/site/profile/manifests/webhook_mcollective.pp new file mode 100644 index 0000000..395cc7a --- /dev/null +++ b/site/profile/manifests/webhook_mcollective.pp @@ -0,0 +1,15 @@ +class profile::webhook_mcollective { + + class { 'r10k::mcollective': + notify => Service['mcollective'], + } + + include r10k::webhook::config + + class {'r10k::webhook': + user => 'root', + group => '0', + require => Class['r10k::webhook::config'], + } + +} diff --git a/site/profile/manifests/webhook_no_mcollective.pp b/site/profile/manifests/webhook_no_mcollective.pp new file mode 100644 index 0000000..42c4954 --- /dev/null +++ b/site/profile/manifests/webhook_no_mcollective.pp @@ -0,0 +1,13 @@ +class profile::webhook_no_mcollective { + + class {'r10k::webhook::config': + use_mcollective => false, + } + + class {'r10k::webhook': + user => 'root', + group => '0', + require => Class['r10k::webhook::config'], + } + +} diff --git a/site/role/manifests/all_in_one_pe.pp b/site/role/manifests/all_in_one_pe.pp index ca99139..f34a261 100644 --- a/site/role/manifests/all_in_one_pe.pp +++ b/site/role/manifests/all_in_one_pe.pp @@ -1,5 +1,6 @@ class role::all_in_one_pe { + include profile::webhook_no_mcollective include profile::puppetmaster } -- cgit v1.2.3 From 65820675e5d02ed55c2cd3627a0d95a5ed9b6ac0 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 20 Oct 2015 21:24:44 -0700 Subject: Change the zack/r10k webhook to not authenticate --- README.md | 32 +++++++++++++++++++++++- site/profile/manifests/webhook_no_mcollective.pp | 2 ++ 2 files changed, 33 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 2125c09..2e6bc99 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html 7. Add your user to the `puppet` group as well 7. Create a project called `control-repo` and set the Namespace to be the `puppet` group + - Set the permissions of the project to `Public' + - We'll change this back to private at the end 8. Logout of root and login as the `r10k_api_user` - Go to profile settings -> account ( https:///profile/account ) @@ -69,6 +71,8 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html - edit `git_management_system` to be 'gitlab' - edit the `gms_server_url` +11. `git add hieradata/nodes/.yaml` + 11. `git commit -m "renaming example-puppet-master.yaml"` 11. Rename my repository as the upstream remote @@ -77,9 +81,13 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html 12. Add your internal repository as the origin remote - `git remote add origin ` +13. `git branch --set-upstream-to origin/production` + 13. Push the production branch of the repository from your machine up to your git server - `git push origin production` +14. Change the permission of control-repo in your gitlab server to `private` + ###Stash ###Github @@ -109,7 +117,7 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html 7. Push the production branch of the repository from your machine up to your git server - `git push origin production` -8. Find the url to your internal repo this is usually on the front page of the repo +8. Find the url to your internal repo. This is usually on the front page of the repo 9. Add the repo as a remote - git remote add origin git@your-git-server:puppet/control-repo.git @@ -131,6 +139,28 @@ If you run into any issues or have more questions about the installer you can se http://docs.puppetlabs.com/pe/latest/install_basic.html +##Get the Control-Repo Deployed On Your Master + +At this point you have my control-repo code deployed into your git server. However, we have one final challenge getting that code onto your puppet master. In the end state the master will pull code from the git server via r10k, however, at this moment your puppet master doesn't have credentials to get code from the git server. + +So, we'll set up a deploy key in the git server that will allow a ssh-key we make to deploy the code and configure everything else. + +1. On your puppet master, make an ssh key for r10k to connect to gitlab + - `/usr/bin/ssh-keygen -t rsa -b 2048 -C 'r10k' -f /root/.ssh/r10k_rsa -q -N ''` + - http://doc.gitlab.com/ce/ssh/README.html + - https://help.github.com/articles/generating-ssh-keys/ +2. Create a deploy key on the `control-repo` project in Gitlab + - paste in the public key from above +3. Follow https://docs.puppetlabs.com/pe/latest/r10k_config_console.html + - The remote is on the front page of the project in the gitlab UI + - git_settings should be: + - `{"provider": "rugged", + "private_key": "/root/.ssh/r10k_rsa"}` +3. Run `puppet agent -t` + - Expect to see changes to `r10k.yaml` +3. Run `r10k deploy environment -pv` +4. Run `puppet agent -t` + ### Update Your Existing Install To Point To The Control Repository https://docs.puppetlabs.com/pe/latest/r10k_config_console.html diff --git a/site/profile/manifests/webhook_no_mcollective.pp b/site/profile/manifests/webhook_no_mcollective.pp index 42c4954..a245cf0 100644 --- a/site/profile/manifests/webhook_no_mcollective.pp +++ b/site/profile/manifests/webhook_no_mcollective.pp @@ -1,6 +1,8 @@ class profile::webhook_no_mcollective { class {'r10k::webhook::config': + enable_ssl => false, + protected => false, use_mcollective => false, } -- cgit v1.2.3 From 726052fefcc82b408149b887c95de77ec88343fa Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 20 Oct 2015 21:27:11 -0700 Subject: Remove notes about making control-repo public --- README.md | 4 ---- 1 file changed, 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 2e6bc99..1a0afa6 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,6 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html 7. Add your user to the `puppet` group as well 7. Create a project called `control-repo` and set the Namespace to be the `puppet` group - - Set the permissions of the project to `Public' - - We'll change this back to private at the end 8. Logout of root and login as the `r10k_api_user` - Go to profile settings -> account ( https:///profile/account ) @@ -86,8 +84,6 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html 13. Push the production branch of the repository from your machine up to your git server - `git push origin production` -14. Change the permission of control-repo in your gitlab server to `private` - ###Stash ###Github -- cgit v1.2.3 From 2ffc83ac7c702ab96a604baea7ddf3b454b1f9ab Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Wed, 21 Oct 2015 08:58:52 -0700 Subject: Clean up the README so it works from top to bottom I removed some extraneos notes I had and added a few more bits of documentation. --- README.md | 62 ++++++++++++++++++++------------------------------------------ 1 file changed, 20 insertions(+), 42 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 1a0afa6..333d136 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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. +If you intend to use it on an existing installation then 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 @@ -86,41 +86,11 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html ###Stash -###Github - -###The General Idea - Not Specific to GMS - -1. Make an user in your internal git server for yourself - -2. 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 ) - - - https://help.github.com/articles/generating-ssh-keys/ - -3. Create a group or organization called "puppet" - -4. Create a repository in your git server called control-repo - -4. Clone this control repository to your laptop/workstation - - `git clone https://github.com/npwalker/control-repo.git` - - `cd control-repo` - -5. Rename my repository as the upstream remote - - `git remote rename origin upstream` - -6. Add your internal repository as the origin remote - - `git remote add origin ` +Coming soon! -7. Push the production branch of the repository from your machine up to your git server - - `git push origin production` - -8. Find the url to your internal repo. This is usually on the front page of the repo - -9. Add the repo as a remote - - git remote add origin git@your-git-server:puppet/control-repo.git - -10. Push the repository from your machine up to your git server +###Github - - git push origin production +Coming soon! ##Configure PE to Use the Control-Repo @@ -135,7 +105,7 @@ If you run into any issues or have more questions about the installer you can se http://docs.puppetlabs.com/pe/latest/install_basic.html -##Get the Control-Repo Deployed On Your Master +###Get the Control-Repo Deployed On Your Master At this point you have my control-repo code deployed into your git server. However, we have one final challenge getting that code onto your puppet master. In the end state the master will pull code from the git server via r10k, however, at this moment your puppet master doesn't have credentials to get code from the git server. @@ -146,25 +116,33 @@ So, we'll set up a deploy key in the git server that will allow a ssh-key we mak - http://doc.gitlab.com/ce/ssh/README.html - https://help.github.com/articles/generating-ssh-keys/ 2. Create a deploy key on the `control-repo` project in Gitlab - - paste in the public key from above + - Paste in the public key from above + - `cat /root/.ssh/r10k_rsa.pub` 3. Follow https://docs.puppetlabs.com/pe/latest/r10k_config_console.html - The remote is on the front page of the project in the gitlab UI - git_settings should be: - - `{"provider": "rugged", + - `{"provider": "rugged", "private_key": "/root/.ssh/r10k_rsa"}` 3. Run `puppet agent -t` - Expect to see changes to `r10k.yaml` 3. Run `r10k deploy environment -pv` -4. Run `puppet agent -t` +4. Run `puppet agent -t` + - Now you should see many more changes -### Update Your Existing Install To Point To The Control Repository -https://docs.puppetlabs.com/pe/latest/r10k_config_console.html +## Test The Zack/r10k Webhook -## Run r10k +One of the components setup by this control-repo is that when you "push" code to your git server, the git server will inform the puppet master to run `r10k deploy environment -p`. -1. Run `r10k deploy environment -pv` and watch it install the modules from your Puppetfile +1. Edit README.md + - Just add something to it +2. `git add README.md` +3. `git commit -m "edit README"` +4. `git push origin production` +5. Allow the push to complete and then give it few seconds to complete + - Open `/etc/puppetlabs/code/environments/production/README.md` and confirm your change is present + ---- #Miscellaneous -- cgit v1.2.3 From ac0f1b0cdc7f0a6dff8e2922f12e6af6f1dc986c Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Thu, 22 Oct 2015 15:43:36 -0700 Subject: Multiple fixes to the README fix step 16 and 17 being out of order fix a step that referred erronously to step 4 change the numbering to be reflective of actual numbering --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 333d136..70383ab 100644 --- a/README.md +++ b/README.md @@ -53,37 +53,37 @@ http://docs.puppetlabs.com/pe/latest/regenerate_certs_master.html 7. Add your user to the `puppet` group as well -7. Create a project called `control-repo` and set the Namespace to be the `puppet` group +8. Create a project called `control-repo` and set the Namespace to be the `puppet` group -8. Logout of root and login as the `r10k_api_user` +9. Logout of root and login as the `r10k_api_user` - Go to profile settings -> account ( https:///profile/account ) - Copy the api token -9. Clone this control repository to your laptop/workstation +10. Clone this control repository to your laptop/workstation - `git clone https://github.com/npwalker/control-repo.git` - `cd control-repo` -10. `git mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/.yaml` +11. `git mv hieradata/nodes/example-puppet-master.yaml hieradata/nodes/.yaml` - Open `hieradata/nodes/.yaml` - edit `gms_api_token` to be your api token - edit `git_management_system` to be 'gitlab' - edit the `gms_server_url` -11. `git add hieradata/nodes/.yaml` +12. `git add hieradata/nodes/.yaml` -11. `git commit -m "renaming example-puppet-master.yaml"` +13. `git commit -m "renaming example-puppet-master.yaml"` -11. Rename my repository as the upstream remote +14. Rename my repository as the upstream remote - `git remote rename origin upstream` -12. Add your internal repository as the origin remote - - `git remote add origin ` +15. Add your internal repository as the origin remote + - `git remote add origin ` -13. `git branch --set-upstream-to origin/production` - -13. Push the production branch of the repository from your machine up to your git server +16. Push the production branch of the repository from your machine up to your git server - `git push origin production` +17. `git branch --set-upstream-to origin/production` + ###Stash Coming soon! -- cgit v1.2.3