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
2
24
3
25
This control repo and the steps below are intended to be used during a new installation of PE.
4
26
5
-
This control repo has only been tested against PE2015.2.z, it's likely close to working on PE3.8.z but has not been tested.
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)
6
28
7
-
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.
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.
30
+
31
+
# What You Get From This control-repo
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...
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
8
42
9
43
## Setup a Trusted Fact On Your PE Master
10
44
@@ -17,15 +51,15 @@ extension_requests:
17
51
1.3.6.1.4.1.34380.1.1.13: 'all_in_one_pe'
18
52
```
19
53
20
-
### If You Have Not Installed PE
54
+
### If You Have Not Installed PE
21
55
22
-
Good then you can proceed forward and the trusted fact will be used when you get to the install step.
56
+
Good then you can proceed forward and the trusted fact will be used when you get to the install step.
23
57
24
58
### If You Have Already Installed PE
25
59
26
-
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.
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.
27
61
28
-
Follow this document to regenerate the certificate on your master.
62
+
Follow this document to regenerate the certificate 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
+
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.
113
147
114
-
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.
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.
115
149
116
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
133
174
175
+
## Test Code Manager
134
176
135
-
## Test The Zack/r10k Webhook
136
-
137
-
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`.
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.
138
178
139
-
1. Edit README.md
140
-
- Just add something to it
141
-
2.`git add README.md`
142
-
3.`git commit -m "edit README"`
143
-
4.`git push origin production`
144
-
5. Allow the push to complete and then give it few seconds to complete
145
-
- Open `/etc/puppetlabs/code/environments/production/README.md` and confirm your change is present
146
-
147
-
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
148
189
149
190
----
150
-
#Miscellaneous
151
-
152
-
## If You Want to Install Pointing To This Repo on Github
191
+
# Updating From a Previous Version of PE
153
192
154
-
### Setting Up Gitlab
193
+
##Upgrading to PE2015.3.z from PE 2015.2.z
155
194
156
-
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).
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.
157
196
158
-
```
159
-
---
160
-
extension_requests:
161
-
#pp_role
162
-
1.3.6.1.4.1.34380.1.1.13: 'gitlab'
163
-
```
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.
166
201
167
-
Not yet completed.
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.
168
203
169
-
### Setting up Stash
204
+
#Appendix
170
205
171
-
Not yet completed.
172
-
173
-
174
-
#TODO
175
-
Flush out generating an answer file and then appending extra answers onto the end of it.
206
+
## Test The Zack/r10k Webhook
176
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.
177
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`.
178
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