Skip to content
This repository was archived by the owner on Mar 28, 2019. It is now read-only.

Commit 3b840a1

Browse files
committed
Merge pull request #133 from danieldreier/improve_documentation
Improve readme
2 parents 223ebb6 + 630537a commit 3b840a1

File tree

1 file changed

+181
-20
lines changed

1 file changed

+181
-20
lines changed

README.md

Lines changed: 181 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,146 @@
33

44
100% free range, organic, pesticide free Puppet module for managing Puppet.
55

6+
#### Table of Contents
67

7-
## Usage
8+
1. [Overview](#overview)
9+
2. [Module Description - What the module does and why it is useful](#module-description)
10+
3. [Setup - getting started with puppet-puppet](#setup)
11+
* [What puppet-puppet affects](#what-puppet-puppet-affects)
12+
* [Setup requirements](#setup-requirements)
13+
4. [Usage - Configuration options and additional functionality](#usage)
14+
* [Puppet Master](#puppetmaster-setup)
15+
* [Puppet Agent](#puppet-agent-configuration)
16+
5. [Limitations - OS compatibility, etc.](#limitations)
17+
6. [Development - Guide for contributing to the module](#development)
18+
19+
## Overview
20+
21+
The puppet-puppet module manages puppet masters and agents using puppet.
22+
23+
## Module Description
24+
25+
Puppet masters are frequently the only hand-crafted part of puppet-managed
26+
infrastructure. This module seeks to make the experience of running a puppet
27+
master similar to running Apache, Nginx, or MySQL using puppet.
28+
29+
## Setup
830

31+
### What puppet-puppet affects
932

10-
### Puppetmaster
33+
Depending on how you use this module, it can touch any of:
34+
* Puppet configuration files
35+
* Nginx or Apache configurations needed for running a master
36+
* Unicorn, Passenger, and thin configurations and init scripts
37+
* PuppetDB and PostgreSQL
38+
39+
As far as possible, this module tries to use other general-purpose modules to
40+
configure required non-puppet systems.
41+
42+
### Setup Requirements
43+
44+
Puppet-puppet does not manage SSL certificates. You can generate the
45+
appropriate puppet SSL certificates by starting the webrick-based puppetmaster
46+
before using puppet-puppet. If you don't generate those SSL certs first, the
47+
resulting master won't work. (but should if you generate the certs; it's not
48+
strictly order dependent)
49+
50+
This module also doesn't manage [r10k][r10k-github] or [hiera][hiera-docs].
51+
Look at [zack/r10k][zack-r10k] or [sharpie/r10k][sharpie-r10k] for r10k, and
52+
the [hunner/hiera][hunner-hiera] module for managing hiera. If this is all
53+
unfamiliar, read the [Shit Gary Says](http://garylarizza.com/) blog, starting
54+
with [Building a Functional Puppet Workflow Part 1: Module Structure][sgs-1].
55+
56+
Don't use the forge release of this module until further notice. It's very
57+
outdated and has many known problems. Either use r10k to install it, or build
58+
a puppet module tarball with:
59+
60+
```bash
61+
git clone https://github.com/puppetlabs-operations/puppet-puppet.git
62+
cd puppet-puppet
63+
bundle install
64+
rake build
65+
```
66+
67+
The resulting tarball in the `pkg` folder can be installed using something like
68+
`puppet module install ploperations-puppet-0.12.0.tar.gz` and it will do
69+
dependency resolution for you. This notice will be removed when the forge
70+
version of the module is reasonable to use.
71+
72+
## Usage
73+
There are two general areas managed with this module: masters and agents.
74+
75+
### Puppetmaster Setup
76+
#### Webrick master
1177

1278
At an absolute minimum, you need the following.
1379

14-
``` Puppet
80+
```puppet
1581
class { 'puppet::server':
16-
servertype => 'standalone',
17-
manifest => '/etc/puppet/manifests/site.pp',
18-
ca => true,
82+
servertype => 'standalone',
83+
manifest => '/etc/puppet/manifests/site.pp',
84+
ca => true,
1985
}
2086
```
2187

2288
This should get you a puppetmaster running under `webrick` which might scale to
2389
about `10` nodes if the wind doesn't blow too hard.
2490

2591
If, however, the moon is in the next phase then you probably want to use
26-
something that scales a bit more.
92+
something that scales a bit more. Your options are nginx/unicorn,
93+
apache/passenger, or nginx/thin (but thin support in this module is deprecated
94+
because nobody seems to be using it).
2795

28-
``` Puppet
96+
#### Nginx/Unicorn Master
97+
The most basic setup would look something like:
98+
```puppet
99+
class { 'puppet::server':
100+
servertype => 'unicorn',
101+
ca => true,
102+
}
103+
```
104+
105+
A similar Apache/Passenger server would be:
106+
```puppet
107+
class { 'puppet::server':
108+
servertype => 'passenger',
109+
ca => true,
110+
}
111+
```
112+
113+
#### Master with PuppetDB, PostgreSQL, and reports
114+
Running a puppet master without PuppetDB loses much of the utility of Puppet,
115+
so you probably want it. As a convenience, this module will install puppetdb
116+
and postgresql using the [puppetlabs/puppetdb][puppetlabs-puppetdb] module if
117+
`manage_puppetdb => true` is set.
118+
119+
If you want a more complex setup with PuppetDB and/or PostgreSQL on a different
120+
server, don't enable that option; use the
121+
[puppetlabs/puppetdb][puppetlabs-puppetdb] module directly because it has many
122+
more configuration options that aren't exposed here.
123+
124+
```puppet
29125
class { '::puppet::server':
30-
modulepath => [
31-
'$confdir/modules/site',
32-
'$confdir/env/$environment/dist',
126+
modulepath => [
127+
'$confdir/modules',
128+
'$confdir/environments/$environment/modules/site',
129+
'$confdir/environments/$environment/modules/site/dist',
33130
],
34-
storeconfigs => 'puppetdb',
35-
reporturl => "https://${::fqdn}/reports",
36-
servertype => 'unicorn',
37-
manifest => '$confdir/environments/$environment/site.pp',
38-
ca => true,
39-
reports => [
131+
manage_puppetdb => true,
132+
reporturl => "https://${::fqdn}/reports",
133+
servertype => 'unicorn',
134+
manifest => '$confdir/environments/$environment/site.pp',
135+
ca => true,
136+
reports => [
40137
'https',
41-
'graphite',
42-
'irccat',
43138
'store',
139+
'puppetdb',
44140
],
45141
}
46142
47143
# in a real environment, you'll probably populate parameters on these
48144
# report classes from hiera. For this example, it's specified inline so that
49-
# the manifest works as-is
145+
# the manifest works as-is.
50146
51147
class { 'puppet::reports::graphite':
52148
server => $::fqdn,
@@ -61,3 +157,68 @@ class { 'puppet::reports::irccat':
61157
}
62158
```
63159

160+
161+
### Puppet Agent Configuration
162+
At the most basic, simply:
163+
```puppet
164+
include puppet::agent
165+
```
166+
167+
That will configure a cron job to run the puppet agent. If that's not what you
168+
want, one of the following may be more to your liking:
169+
170+
#### Running the agent service instead of via cron
171+
```puppet
172+
class { 'puppet::agent':
173+
method => 'service',
174+
}
175+
```
176+
177+
#### Agent using cron, with more configuration options set:
178+
Note that although the parameters correspond with puppet configuration file
179+
option names, only a relatively subset can currently be managed with this
180+
module.
181+
182+
```puppet
183+
class { 'puppet::agent':
184+
server => 'puppet.example.com',
185+
ca_server => 'puppetca.example.com',
186+
report_server => 'puppet_reports.example.com',
187+
method => 'cron',
188+
configtimeout => 900,
189+
}
190+
```
191+
192+
In a production environment, you should probably use `include puppet::agent`
193+
and populate parameters using [hiera automatic parameter lookup][hiera-lookup]
194+
instead of hardcoding these values into manifests.
195+
196+
## Limitations
197+
198+
This module is (basically) only tested on Debian Wheezy. The maintainers care
199+
about FreeBSD and OpenBSD support. A token gesture of EL support exists in
200+
`params.pp` but that's about it; this probably won't do much on CentOS/RedHat.
201+
Pull requests welcome if you're interested.
202+
203+
Bootstrapping an all-in-one (master, puppetdb, postgresql) puppetmaster with
204+
puppet-puppet is relatively straightforward. However, building a usable puppet
205+
infrastructure with it requires additional steps, such as figuring out how you
206+
want to deploy manifests and modules to your master. (tip: use r10k)
207+
208+
You should definitely not use this module on an existing production
209+
puppetmaster unless you've tested it extensively. This is a tool developed by
210+
sysadmins, not developers, and testing is very incomplete.
211+
212+
## Development
213+
214+
Read CONTRIBUTING.md to see instructions on running beaker and rspec tests.
215+
216+
[puppetlabs-puppetdb]: https://github.com/puppetlabs/puppet-puppetdb
217+
[puppetlabs-apache]: https://github.com/puppetlabs/puppetlabs-apache
218+
[jfryman-nginx]: https://github.com/jfryman/puppet-nginx
219+
[r10k]: https://github.com/adrienthebo/r10k
220+
[hiera-lookup]: https://docs.puppetlabs.com/hiera/1/puppet.html#automatic-parameter-lookup
221+
[hiera-docs]: https://docs.puppetlabs.com/hiera/1/
222+
[zack-r10k]: https://forge.puppetlabs.com/zack/r10k
223+
[sharpie-r10k]: https://github.com/Sharpie/puppet-r10k
224+
[sgs-1]: http://garylarizza.com/blog/2014/02/17/puppet-workflow-part-1/

0 commit comments

Comments
 (0)