File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 32
32
# ['puppetdb_startup_timeout'] - The timeout for puppetdb
33
33
# ['dns_alt_names'] - Comma separated list of alternative DNS names
34
34
# ['digest_algorithm'] - The algorithm to use for file digests.
35
- # ['webserver'] - install 'nginx' (with unicorn) or 'httpd' (with passenger)
35
+ # ['webserver'] - install 'nginx' (with unicorn) or 'httpd' (with passenger) - httpd is default
36
+ # ['listen_address'] - IP for binding the webserver, defaults to *
36
37
#
37
38
# Requires:
38
39
#
84
85
$puppetdb_strict_validation = $::puppet::params::puppetdb_strict_validation,
85
86
$dns_alt_names = [' puppet' ],
86
87
$digest_algorithm = $::puppet::params::digest_algorithm,
87
- $webserver = ' httpd' ,
88
+ $webserver = $::puppet::params::default_webserver,
89
+ $listen_address = $::puppet::params::listen_address,
88
90
) inherits puppet::params {
89
91
90
92
anchor { 'puppet::master::begin' : }
123
125
case $webserver {
124
126
nginx: {
125
127
Anchor[' puppet::master::begin' ] ->
126
- class {'puppet::unicorn' :} ->
128
+ class {'puppet::unicorn' :
129
+ listen_address => $listen_address ,
130
+ } ->
127
131
Anchor[' puppet::master::end' ]
128
132
}
129
133
default: {
Original file line number Diff line number Diff line change 31
31
$puppetdb_strict_validation = true
32
32
$environments = ' config'
33
33
$digest_algorithm = ' md5'
34
+ $listen_address = ' *'
35
+ $default_webserver = ' httpd'
34
36
35
37
# Only used when environments == directory
36
38
$environmentpath = ' $confdir/environments'
Original file line number Diff line number Diff line change 1
1
# Class: puppet::unicorn
2
2
#
3
3
# Parameters:
4
- # none
4
+ # - listen_address - IP for binding the nginx
5
5
#
6
6
# Actions:
7
7
# - Configures nginx and unicorn for puppet master use. Tested only on CentOS 7
10
10
# - nginx
11
11
#
12
12
# Sample Usage:
13
- # class {'puppet::unicorn':}
13
+ # class {'puppet::unicorn':
14
+ # listen_address => '10.250.250.1',
15
+ # }
14
16
#
15
17
# written by Tim 'bastelfreak' Meusel
16
18
# with big help from Rob 'rnelson0' Nelson
17
19
18
- class puppet::unicorn () {
20
+ class puppet::unicorn (
21
+ $listen_address,
22
+ ){
19
23
include nginx
20
24
# install unicorn
21
- package {[' ruby-devel' , ' gcc' ]:
25
+ unless defined (Package[' ruby-devel' ]) {
26
+ package {'ruby-devel' :
27
+ ensure => ' latest' ,
28
+ }
29
+ }
30
+ package {'gcc' :
22
31
ensure => ' latest' ,
23
32
} ->
24
33
package {[' unicorn' , ' rack' ]:
25
34
ensure => ' latest' ,
26
35
provider => ' gem' ,
36
+ require => Package[' ruby-devel' ],
27
37
} ->
28
38
file {'copy-config' :
29
39
path => ' /etc/puppet/config.ru' ,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ server {
20
20
proxy_set_header X-Client-DN $ssl_client_s_dn;
21
21
proxy_set_header X-SSL-Subject $ssl_client_s_dn;
22
22
proxy_set_header X-SSL-Issuer $ssl_client_i_dn;
23
- listen * :8140 ssl;
23
+ listen <%= @listen_address %> :8140 ssl;
24
24
root /var/empty;
25
25
location / {
26
26
proxy_pass http://puppetmaster_unicorn;
You can’t perform that action at this time.
0 commit comments