You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[What You Get From This control\-repo](#what-you-get-from-this-control-repo)
6
-
*[How To Set It All Up](#how-to-set-it-all-up)
7
-
*[Setup a Trusted Fact On Your PE Master](#setup-a-trusted-fact-on-your-pe-master)
8
-
*[If You Have Not Installed PE](#if-you-have-not-installed-pe)
9
-
*[If You Have Already Installed PE](#if-you-have-already-installed-pe)
10
-
*[Copy This Repo Into Your Own Git Server](#copy-this-repo-into-your-own-git-server)
11
-
*[Gitlab](#gitlab)
12
-
*[Stash](#stash)
13
-
*[Github](#github)
14
-
*[Configure PE to Use the Control\-Repo](#configure-pe-to-use-the-control-repo)
15
-
*[Install PE](#install-pe)
16
-
*[Get the Control\-Repo Deployed On Your Master](#get-the-control-repo-deployed-on-your-master)
17
-
*[Test Code Manager](#test-code-manager)
18
-
*[Updating From a Previous Version of PE](#updating-from-a-previous-version-of-pe)
19
-
*[Upgrading to PE2015\.3\.z from PE 2015\.2\.z](#upgrading-to-pe20153z-from-pe-20152z)
20
-
*[Appendix](#appendix)
21
-
*[Test The Zack/r10k Webhook](#test-the-zackr10k-webhook)
22
-
23
-
# Before Starting
24
-
25
-
This control repo and the steps below are intended to be used during a new installation of PE.
26
-
27
-
The instructions are geared towards a new installation of PE2015.3.z. However, the control-repo should work just fine on [PE2015.2.z](#upgrading-to-pe20153z-from-pe-20152z)
28
-
29
-
If you intend to use this control-repo 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.
4
+
*[Where Did All The Previous Code Go?](#where-did-all-the-previous-code-go)
5
+
*[What You Get From This control\-repo](#what-you-get-from-this-control-repo)
6
+
*[Copy This Repo Into Your Own Git Server](#copy-this-repo-into-your-own-git-server)
7
+
*[Gitlab](#gitlab)
8
+
*[Stash](#stash)
9
+
*[Github](#github)
10
+
11
+
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc.go)
12
+
13
+
# Where Did All The Previous Code Go?
14
+
15
+
Initially, the control-repo project began as a 'starter' template for anyone
16
+
who wanted to get started with R10k. As time passed (and Code Manager was
17
+
integrated into Puppet Enterprise), the scope of this project grew to include
18
+
opinionated Puppet profiles to setup many Puppet Enterprise components. As the
19
+
code increased, so did the complexity of the control-repo project. To reduce
20
+
that complexity, as well as continue to meet the needs of individuals who would
21
+
like a more minimal template, this repository was stripped of anything other
22
+
than the bare minimum files necessary to get started with a functioning
23
+
control-repo. All of the code that was previously in this repository still
24
+
exists in separate repositories under the [Puppet Labs RampUp Program namespace within Github](https://github.com/PuppetLabs-RampUpProgram)
25
+
and can easily be re-connected to an existing control-repo if that is required
26
+
(simply add the modules to the Puppetfile). Alternatively, if that
27
+
previously-opinoinated control-repo is desired, [it still exists on Github under the Puppet Labs RampUp Program namespace.](https://github.com/PuppetLabs-RampUpProgram/control-repo)
28
+
This control-repo project will remain a template for anyone who would like a minimal
29
+
'starter' template.
30
30
31
31
# What You Get From This control-repo
32
32
33
-
As a result of following the instructions below you will receive at least the beginning of a best-practices installation of PE including...
33
+
This repository exists as a template control-repo that can be used with R10k or Puppet Enterprise Code Manager.
34
34
35
-
- A git server
36
-
- The ability to push code to your git server and have it automatically deployed to your PE Master
37
-
- A config_version script to output the commit of code that your agent just applied
38
-
- Optimal tuning of PE settings for this configuration
39
-
- Working and example roles/profiles code
40
-
41
-
# How To Set It All Up
42
-
43
-
## Setup a Trusted Fact On Your PE Master
44
-
45
-
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`
46
-
47
-
```
48
-
---
49
-
extension_requests:
50
-
#pp_role
51
-
1.3.6.1.4.1.34380.1.1.13: 'all_in_one_pe'
52
-
```
53
-
54
-
### If You Have Not Installed PE
55
-
56
-
Good then you can proceed forward and the trusted fact will be used when you get to the install step.
57
-
58
-
### If You Have Already Installed PE
59
-
60
-
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.
61
-
62
-
Follow this document to regenerate the certificate on your master.
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 )
55
+
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 )
At this point you have our 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.
147
-
148
-
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.
149
-
150
-
1. On your puppet master, make an ssh key for r10k to connect to gitlab
- Your code has been deployed with code manager now
174
-
175
-
## Test Code Manager
176
-
177
-
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 deploy branch you just pushed.
178
-
179
-
1. In one terminal window, `tail -f /var/log/puppetlabs/puppetserver/puppetserver.log`
180
-
2. In a second terminal window
181
-
- Add a new file, `touch test_file`
182
-
-`git add test_file`
183
-
-`git commit -m "adding a test_file"`
184
-
-`git push origin production`
185
-
3. Allow the push to complete and then wait a few seconds for everything to sync over
4. In your first terminal window review the `puppetserver.log` to see the type of logging each sync will create
189
-
190
-
----
191
-
# Updating From a Previous Version of PE
192
-
193
-
## Upgrading to PE2015.3.z from PE 2015.2.z
194
-
195
-
Remove `pe_r10k` from the PE master group in the console and instead add the following two parameters to the `puppet_enterprise::profile::master` class under the PE master group.
196
-
197
-
-`r10k_remote` = the ssh url for your internal repo
When upgrading the `puppet_enterprise::profile::master` class has the `file_sync_enabled` parameter set to `false`. This parameter should be removed so that code manager can configure file sync.
201
-
202
-
Finally, you’ll need to `echo 'code_manager_mv_old_code=true' > /opt/puppetlabs/facter/facts.d/code_manager_mv_old_code.txt` so that my puppet code will redeploy all of your code with code manager.
203
-
204
-
# Appendix
205
-
206
-
## Test The Zack/r10k Webhook
207
-
208
-
If you are using PE2015.2.z or if you've forced the use of the zack/r10k webhook then you'll want to test that it works.
209
-
210
-
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`.
211
-
212
-
1. Edit README.md
213
-
- Just add something to it
214
-
2.`git add README.md`
215
-
3.`git commit -m "edit README"`
216
-
4.`git push origin production`
217
-
5. Allow the push to complete and then give it few seconds to complete
218
-
- Open `/etc/puppetlabs/code/environments/production/README.md` and confirm your change is present
0 commit comments