Update README some more

This commit is contained in:
Nick Walker 2015-09-24 16:03:26 -07:00
parent 0c486e2fcc
commit 03d6c0c74c

166
README.md
View File

@ -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. 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,53 +15,135 @@ extension_requests:
1.3.6.1.4.1.34380.1.1.13: 'all_in_one_pe' 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 Good then you can proceed forward and the trusted fact will be used when you get to the install step.
- https://puppetlabs.com/download-puppet-enterprise-expand
2. Expand the tarball and `cd` into the directory
3. Run `puppet-enterprise-installer` to install
### If You Have Already Installed PE
## How to Copy This Repo Into Your Own Git Server 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
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`
3. Make an user for yourself
4. Make an ssh key to link with your user. Youll 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/
5. Create a group called `puppet` ( this is case sensitive )
- http://doc.gitlab.com/ce/workflow/groups.html
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
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://<your_gitlab_server>/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`
10. `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'
- You should not need to edit the `gms_server_url`
11. 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 <url of your repository from step 4>`
13. 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
1. Make an user in your internal git server for yourself 1. Make an user in your internal git server for yourself
2. Make an ssh key to link with your user. Youll want to do this on the machine you intend to edit code from ( most likely not your puppet master but your local workstation / laptop ) 2. Make an ssh key to link with your user. Youll 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/ - https://help.github.com/articles/generating-ssh-keys/
3. Create a group or organization called "puppet" 3. Create a group or organization called "puppet"
4. Create a repository in your git server called control-repo 4. Create a repository in your git server called control-repo
4. Upload this control repository to your control repository 4. Clone this control repository to your laptop/workstation
- 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` - `cd control-repo`
- `rm -rf .git`
6. `git init` 5. 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 6. Add your internal repository as the origin remote
- Add the repo as a remote - `git remote add origin <url of your repository from step 4>`
- git remote add origin git@gitlab-server:root/control-repo.git
8. Push the repository from your machine up to your git server 7. Push the production branch of the repository from your machine up to your git server
- `git push origin production` - `git push origin production`
## Update Your Install To Point To The Control Repository 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
- git push origin production
##Configure PE to Use the Control-Repo
###Install PE
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
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 https://docs.puppetlabs.com/pe/latest/r10k_config_console.html
## Setting Up Your Git Management System ## 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 ### Setting Up Gitlab
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). 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).
``` ```
--- ---
@ -70,30 +152,6 @@ https://docs.puppetlabs.com/pe/latest/r10k_config_console.html
1.3.6.1.4.1.34380.1.1.13: 'gitlab' 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.
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
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. 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
7. `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'
- You should not need to edit the `gms_server_url`
### Setting up Github ### Setting up Github
Not yet completed. Not yet completed.
@ -103,18 +161,8 @@ Not yet completed.
Not yet completed. Not yet completed.
## 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 #TODO
Flush out generating an answer file and then appending these answers onto the end of it. Flush out generating an answer file and then appending extra answers onto the end of it.
## Run r10k
1. Run `r10k deploy environment —verbose` and watch it install the modules from your Puppetfile