Skip to content

Commit 157a350

Browse files
author
Tim Meusel
committed
Conflicts: Modulefile manifests/master.pp manifests/passenger.pp
2 parents 4d4bc05 + fc66d30 commit 157a350

18 files changed

+250
-101
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Gemfile.lock
55
.bundle/
66
.rspec_system/
77
vendor/
8+
.vagrant

CHANGELOG

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,20 @@
6161
2014-10-10 Stephen Johnson <[email protected]> - 1.1.0
6262
* Add new templatedir paramter to agent
6363
* Add external_nodes and node_terminus <Jesi Major>
64+
2014-12-09 Stephen Johnson <[email protected]> - 1.2.0
65+
* move cron command to class parameter <g.chernyshev>
66+
* Use double-quotes to allow variable expansion in environmentpath <Robin Bowes>
67+
* Allow passenger tempdir to be configurable <Robin Bowes>
68+
* Fix for future parse <Tim Meusel>
69+
* Fix sections settings for various configuration params <Benjamin Krein>
70+
* templatedir is deprecated, so do not add by default <Michael Arnold>
71+
* Let Puppet deal with setting it's own permissions <Michael Arnold>
72+
* Added configtimeout setting to puppet::agent to allow override of this default setting <Jesi Major>
73+
* Add new flag to make ssl cert generation optional <Robin Bowes>
74+
2014-12-31 Stephen Johnson <[email protected]> - 1.3.0
75+
* missing @ in the variable <primeministerp>
76+
* Remove RackAutoDetect and RailsAutoDetest <Stephen Johnson>
77+
* Add acceptance tests for redhat <Stephen Johnson>
78+
* Add new metadata file for puppetforge <Stephen Johnson>
79+
2014-12-31 Stephen Johnson <[email protected]> - 1.3.1
80+
* Cleanup some lint items <Stephen Johnson>

Modulefile

Lines changed: 0 additions & 14 deletions
This file was deleted.

manifests/agent.pp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# ['version'] - The version of the puppet agent to install
1111
# ['puppet_run_style'] - The run style of the agent either 'service', 'cron', 'external' or 'manual'
1212
# ['puppet_run_interval'] - The run interval of the puppet agent in minutes, default is 30 minutes
13+
# ['puppet_run_command'] - The command that will be executed for puppet agent run
1314
# ['user_id'] - The userid of the puppet user
1415
# ['group_id'] - The groupid of the puppet group
1516
# ['splay'] - If splay should be enable defaults to false
@@ -48,6 +49,7 @@
4849
$version = 'present',
4950
$puppet_run_style = 'service',
5051
$puppet_run_interval = 30,
52+
$puppet_run_command = '/usr/bin/puppet agent --no-daemonize --onetime --logdest syslog > /dev/null 2>&1',
5153
$user_id = undef,
5254
$group_id = undef,
5355
$splay = false,
@@ -128,7 +130,7 @@
128130
$time2 = fqdn_rand($puppet_run_interval) + 30
129131

130132
cron { 'puppet-client':
131-
command => '/usr/bin/puppet agent --no-daemonize --onetime --logdest syslog > /dev/null 2>&1',
133+
command => $puppet_run_command,
132134
user => 'root',
133135
# run twice an hour, at a random minute in order not to collectively stress the puppetmaster
134136
hour => '*',
@@ -237,9 +239,9 @@
237239
}
238240

239241
ini_setting {'puppetagentmaster':
240-
ensure => present,
241-
setting => 'server',
242-
value => $puppet_server,
242+
ensure => present,
243+
setting => 'server',
244+
value => $puppet_server,
243245
}
244246

245247
ini_setting {'puppetagentuse_srv_records':

manifests/master.pp

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
# ['backup_upstream'] - specify another puppet master as fallback. currently only supported by nginx
3939
# ['unicorn_package'] - package name of a unicorn rpm. if provided we install it, otherwise we built it via gem/gcc
4040
# ['unicorn_path'] - custom path to the unicorn binary
41+
# ['generate_ssl_certs'] - Generate ssl certs (false to disable)
4142
#
4243
# Requires:
4344
#
@@ -78,7 +79,12 @@
7879
$puppet_ssldir = $::puppet::params::puppet_ssldir,
7980
$puppet_docroot = $::puppet::params::puppet_docroot,
8081
$puppet_vardir = $::puppet::params::puppet_vardir,
82+
<<<<<<< HEAD
8183
$puppet_proxy_port = $::puppet::params::puppet_proxy_port,
84+
=======
85+
$puppet_passenger_port = $::puppet::params::puppet_passenger_port,
86+
$puppet_passenger_tempdir = false,
87+
>>>>>>> fc66d308fddf8bc4cb351e5e5bdf540d432c2aaf
8288
$puppet_master_package = $::puppet::params::puppet_master_package,
8389
$puppet_master_service = $::puppet::params::puppet_master_service,
8490
$version = 'present',
@@ -89,12 +95,17 @@
8995
$puppetdb_strict_validation = $::puppet::params::puppetdb_strict_validation,
9096
$dns_alt_names = ['puppet'],
9197
$digest_algorithm = $::puppet::params::digest_algorithm,
98+
<<<<<<< HEAD
9299
$webserver = $::puppet::params::default_webserver,
93100
$listen_address = $::puppet::params::listen_address,
94101
$disable_ssl = $::puppet::params::disable_ssl,
95102
$backup_upstream = $::puppet::params::backup_upstream,
96103
$unicorn_path = $::puppet::params::unicorn_path,
97104
$unicorn_package = $::puppet::params::unicorn_package,
105+
=======
106+
$generate_ssl_certs = true,
107+
$puppetdb_version = 'present',
108+
>>>>>>> fc66d308fddf8bc4cb351e5e5bdf540d432c2aaf
98109
) inherits puppet::params {
99110

100111
anchor { 'puppet::master::begin': }
@@ -146,23 +157,25 @@
146157
default: {
147158
Anchor['puppet::master::begin'] ->
148159
class {'puppet::passenger':
149-
puppet_proxy_port => $puppet_proxy_port,
150-
puppet_docroot => $puppet_docroot,
151-
apache_serveradmin => $apache_serveradmin,
152-
puppet_conf => $::puppet::params::puppet_conf,
153-
puppet_ssldir => $puppet_ssldir,
154-
certname => $certname,
155-
conf_dir => $::puppet::params::confdir,
156-
dns_alt_names => join($dns_alt_names,','),
160+
puppet_proxy_port => $puppet_passenger_port,
161+
puppet_docroot => $puppet_docroot,
162+
apache_serveradmin => $apache_serveradmin,
163+
puppet_conf => $::puppet::params::puppet_conf,
164+
puppet_ssldir => $puppet_ssldir,
165+
certname => $certname,
166+
conf_dir => $::puppet::params::confdir,
167+
dns_alt_names => join($dns_alt_names,','),
168+
generate_ssl_certs => $generate_ssl_certs,
169+
puppet_passenger_tempdir => $puppet_passenger_tempdir,
157170
} ->
158171
Anchor['puppet::master::end']
159172
}
160173

161174
}
162175
service { $puppet_master_service:
163-
ensure => stopped,
164-
enable => false,
165-
require => File[$::puppet::params::puppet_conf],
176+
ensure => stopped,
177+
enable => false,
178+
require => File[$::puppet::params::puppet_conf],
166179
}
167180

168181
if ! defined(File[$::puppet::params::puppet_conf]){
@@ -212,11 +225,12 @@
212225
dbserver => $storeconfigs_dbserver,
213226
dbport => $storeconfigs_dbport,
214227
puppet_service => Service[$webserver],
215-
puppet_confdir => $::puppet::params::puppet_confdir,
228+
puppet_confdir => $::puppet::params::confdir,
216229
puppet_conf => $::puppet::params::puppet_conf,
217230
puppet_master_package => $puppet_master_package,
218231
puppetdb_startup_timeout => $puppetdb_startup_timeout,
219232
puppetdb_strict_validation => $puppetdb_strict_validation,
233+
puppetdb_version => $puppetdb_version,
220234
} ->
221235
Anchor['puppet::master::end']
222236
}

manifests/masterenv.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
$section = ''
3333
file { "${environmentpath}/${name}":
3434
ensure => directory,
35+
before => [Ini_setting["masterenvmodule${name}"],Ini_setting["masterenvmanifest${name}"]],
3536
}
3637
}
3738
default: {

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
$unicorn_path = '/usr/local/bin/unicorn'
4040

4141
# Only used when environments == directory
42-
$environmentpath = '$confdir/environments'
42+
$environmentpath = "${confdir}/environments"
4343

4444
case $::osfamily {
4545
'RedHat': {

manifests/passenger.pp

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55
# Parameters:
66
# ['puppet_proxy_port'] - The port for the virtual host
7+
# ['generate_ssl_certs'] - Generate ssl certs (false to disable)
78
# ['puppet_docroot'] - Apache documnet root
89
# ['apache_serveradmin'] - The apache server admin
910
# ['puppet_conf'] - The puppet config dir
@@ -32,6 +33,8 @@
3233
#
3334
class puppet::passenger(
3435
$puppet_proxy_port,
36+
$generate_ssl_certs = true,
37+
$puppet_passenger_tempdir = false,
3538
$puppet_docroot,
3639
$apache_serveradmin,
3740
$puppet_conf,
@@ -46,49 +49,47 @@
4649
include apache::mod::ssl
4750

4851
if $::osfamily == 'redhat' {
49-
file{'/var/lib/puppet/reports':
52+
file { '/var/lib/puppet/reports':
5053
ensure => directory,
5154
owner => $::puppet::params::puppet_user,
5255
group => $::puppet::params::puppet_group,
53-
mode => '0750',
5456
}
57+
}
5558

59+
if str2bool($generate_ssl_certs) == true {
5660
file{"${puppet_ssldir}/ca":
5761
ensure => directory,
5862
owner => $::puppet::params::puppet_user,
5963
group => $::puppet::params::puppet_group,
60-
mode => '0770',
6164
before => Exec['Certificate_Check'],
6265
}
6366

6467
file{"${puppet_ssldir}/ca/requests":
6568
ensure => directory,
6669
owner => $::puppet::params::puppet_user,
6770
group => $::puppet::params::puppet_group,
68-
mode => '0750',
6971
before => Exec['Certificate_Check'],
7072
}
71-
}
73+
# first we need to generate the cert
74+
# Clean the installed certs out ifrst
75+
$crt_clean_cmd = "puppet cert clean ${certname}"
76+
# I would have preferred to use puppet cert generate, but it does not
77+
# return the corret exit code on some versions of puppet
78+
$crt_gen_cmd = "puppet certificate --ca-location=local --dns_alt_names=${dns_alt_names} generate ${certname}"
79+
# I am using the sign command here b/c AFAICT, the sign command for certificate
80+
# does not work
81+
$crt_sign_cmd = "puppet cert sign --allow-dns-alt-names ${certname}"
82+
# find is required to move the cert into the certs directory which is
83+
# where it needs to be for puppetdb to find it
84+
$cert_find_cmd = "puppet certificate --ca-location=local find ${certname}"
7285

73-
# first we need to generate the cert
74-
# Clean the installed certs out ifrst
75-
$crt_clean_cmd = "puppet cert clean ${certname}"
76-
# I would have preferred to use puppet cert generate, but it does not
77-
# return the corret exit code on some versions of puppet
78-
$crt_gen_cmd = "puppet certificate --ca-location=local --dns_alt_names=$dns_alt_names generate ${certname}"
79-
# I am using the sign command here b/c AFAICT, the sign command for certificate
80-
# does not work
81-
$crt_sign_cmd = "puppet cert sign --allow-dns-alt-names ${certname}"
82-
# find is required to move the cert into the certs directory which is
83-
# where it needs to be for puppetdb to find it
84-
$cert_find_cmd = "puppet certificate --ca-location=local find ${certname}"
85-
86-
exec { 'Certificate_Check':
87-
command => "${crt_clean_cmd} ; ${crt_gen_cmd} && ${crt_sign_cmd} && ${cert_find_cmd}",
88-
unless => "/bin/ls ${puppet_ssldir}/certs/${certname}.pem",
89-
path => '/usr/bin:/usr/local/bin',
90-
logoutput => on_failure,
91-
require => File[$puppet_conf]
86+
exec { 'Certificate_Check':
87+
command => "${crt_clean_cmd} ; ${crt_gen_cmd} && ${crt_sign_cmd} && ${cert_find_cmd}",
88+
unless => "/bin/ls ${puppet_ssldir}/certs/${certname}.pem",
89+
path => '/usr/bin:/usr/local/bin',
90+
logoutput => on_failure,
91+
require => File[$puppet_conf]
92+
}
9293
}
9394

9495
file { $puppet_docroot:
@@ -100,24 +101,24 @@
100101

101102
apache::vhost { "puppet-${certname}":
102103
port => $puppet_proxy_port,
103-
priority => '40',
104-
docroot => $puppet_docroot,
105-
serveradmin => $apache_serveradmin,
106-
servername => $certname,
107-
ssl => true,
108-
ssl_cert => "${puppet_ssldir}/certs/${certname}.pem",
109-
ssl_key => "${puppet_ssldir}/private_keys/${certname}.pem",
110-
ssl_chain => "${puppet_ssldir}/ca/ca_crt.pem",
111-
ssl_ca => "${puppet_ssldir}/ca/ca_crt.pem",
112-
ssl_crl => "${puppet_ssldir}/ca/ca_crl.pem",
113-
ssl_protocol => 'ALL -SSLv2 -SSLv3',
114-
ssl_cipher => 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK',
104+
priority => '40',
105+
docroot => $puppet_docroot,
106+
serveradmin => $apache_serveradmin,
107+
servername => $certname,
108+
ssl => true,
109+
ssl_cert => "${puppet_ssldir}/certs/${certname}.pem",
110+
ssl_key => "${puppet_ssldir}/private_keys/${certname}.pem",
111+
ssl_chain => "${puppet_ssldir}/ca/ca_crt.pem",
112+
ssl_ca => "${puppet_ssldir}/ca/ca_crt.pem",
113+
ssl_crl => "${puppet_ssldir}/ca/ca_crl.pem",
114+
ssl_protocol => 'ALL -SSLv2 -SSLv3',
115+
ssl_cipher => 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK',
115116
ssl_honorcipherorder => 'On',
116-
ssl_verify_client => 'optional',
117-
ssl_verify_depth => '1',
118-
ssl_options => ['+StdEnvVars', '+ExportCertData'],
119-
rack_base_uris => '/',
120-
directories => [
117+
ssl_verify_client => 'optional',
118+
ssl_verify_depth => '1',
119+
ssl_options => ['+StdEnvVars', '+ExportCertData'],
120+
rack_base_uris => '/',
121+
directories => [
121122
{
122123
path => $puppet_docroot,
123124
},
@@ -126,7 +127,7 @@
126127
options => 'None',
127128
},
128129
],
129-
require => [ File['/etc/puppet/rack/config.ru'], File[$puppet_conf] ],
130+
require => [ File['/etc/puppet/rack/config.ru'], File[$puppet_conf] ],
130131
}
131132

132133
#Hack to add extra passenger configurations for puppetmaster

manifests/storeconfigs.pp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@
2727
# }
2828
#
2929
class puppet::storeconfigs(
30-
$dbserver,
3130
$dbport,
32-
$puppet_service,
31+
$dbserver,
3332
$puppet_master_package,
33+
$puppet_service,
3434
$puppetdb_startup_timeout,
3535
$puppetdb_strict_validation,
36+
$puppetdb_version,
37+
$puppet_conf = $::puppet::params::puppet_conf,
3638
$puppet_confdir = $::puppet::params::confdir,
37-
$puppet_conf = $::puppet::params::puppet_conf
3839
)inherits puppet::params {
3940

4041
##If we point at a puppetdb on this machine
@@ -57,6 +58,7 @@
5758
puppetdb_startup_timeout => $puppetdb_startup_timeout,
5859
strict_validation => $puppetdb_strict_validation,
5960
require => $require,
61+
puppetdb_version => $puppetdb_version,
6062
}
6163
}
6264
}

0 commit comments

Comments
 (0)