Skip to content

Commit 3aaa5f6

Browse files
author
Tim Meusel
committed
add puppet_proxy_port on apache/nginx
this allows us to specify the port where our proxy is listening. defaults to 8140
1 parent 8fc953a commit 3aaa5f6

File tree

8 files changed

+42
-27
lines changed

8 files changed

+42
-27
lines changed

manifests/master.pp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# ['puppet_ssldir'] - Puppet sll directory
2323
# ['puppet_docroot'] - Doc root to be configured in apache vhost
2424
# ['puppet_vardir'] - Vardir used by puppet
25-
# ['puppet_passenger_port'] - Port to configure passenger on default 8140
25+
# ['puppet_proxy_port'] - Port to configure the proxy on - default 8140
2626
# ['puppet_master_package'] - Puppet master package
2727
# ['puppet_master_service'] - Puppet master service
2828
# ['version'] - Version of the puppet master package to install
@@ -74,7 +74,7 @@
7474
$puppet_ssldir = $::puppet::params::puppet_ssldir,
7575
$puppet_docroot = $::puppet::params::puppet_docroot,
7676
$puppet_vardir = $::puppet::params::puppet_vardir,
77-
$puppet_passenger_port = $::puppet::params::puppet_passenger_port,
77+
$puppet_proxy_port = $::puppet::params::puppet_proy_port,
7878
$puppet_master_package = $::puppet::params::puppet_master_package,
7979
$puppet_master_service = $::puppet::params::puppet_master_service,
8080
$version = 'present',
@@ -126,21 +126,22 @@
126126
nginx: {
127127
Anchor['puppet::master::begin'] ->
128128
class {'puppet::unicorn':
129-
listen_address => $listen_address,
129+
listen_address => $listen_address,
130+
puppet_proxy_port => $puppet_proxy_port,
130131
} ->
131132
Anchor['puppet::master::end']
132133
}
133134
default: {
134135
Anchor['puppet::master::begin'] ->
135136
class {'puppet::passenger':
136-
puppet_passenger_port => $puppet_passenger_port,
137-
puppet_docroot => $puppet_docroot,
138-
apache_serveradmin => $apache_serveradmin,
139-
puppet_conf => $::puppet::params::puppet_conf,
140-
puppet_ssldir => $puppet_ssldir,
141-
certname => $certname,
142-
conf_dir => $::puppet::params::confdir,
143-
dns_alt_names => join($dns_alt_names,','),
137+
puppet_proxy_port => $puppet_proxy_port,
138+
puppet_docroot => $puppet_docroot,
139+
apache_serveradmin => $apache_serveradmin,
140+
puppet_conf => $::puppet::params::puppet_conf,
141+
puppet_ssldir => $puppet_ssldir,
142+
certname => $certname,
143+
conf_dir => $::puppet::params::confdir,
144+
dns_alt_names => join($dns_alt_names,','),
144145
} ->
145146
Anchor['puppet::master::end']
146147
}

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
$manifest = '/etc/puppet/manifests/site.pp'
2424
$hiera_config = '/etc/puppet/hiera.yaml'
2525
$puppet_docroot = '/etc/puppet/rack/public/'
26-
$puppet_passenger_port = '8140'
26+
$puppet_proxy_port = '8140'
2727
$puppet_server_port = '8140'
2828
$puppet_agent_enabled = true
2929
$apache_serveradmin = 'root'

manifests/passenger.pp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This class installs and configures the puppetdb terminus pacakge
44
#
55
# Parameters:
6-
# ['puppet_passenger_port'] - The port for the virtual host
6+
# ['puppet_proxy_port'] - The port for the virtual host
77
# ['puppet_docroot'] - Apache documnet root
88
# ['apache_serveradmin'] - The apache server admin
99
# ['puppet_conf'] - The puppet config dir
@@ -21,17 +21,17 @@
2121
#
2222
# Sample Usage:
2323
# class { 'puppet::passenger':
24-
# puppet_passenger_port => 8140,
25-
# puppet_docroot => '/etc/puppet/docroot',
26-
# apache_serveradmin => 'wibble',
27-
# puppet_conf => '/etc/puppet/puppet.conf',
28-
# puppet_ssldir => '/var/lib/puppet/ssl',
29-
# certname => 'puppet.example.com',
30-
# conf_dir => '/etc/puppet',
24+
# puppet_proxyr_port => 8140,
25+
# puppet_docroot => '/etc/puppet/docroot',
26+
# apache_serveradmin => 'wibble',
27+
# puppet_conf => '/etc/puppet/puppet.conf',
28+
# puppet_ssldir => '/var/lib/puppet/ssl',
29+
# certname => 'puppet.example.com',
30+
# conf_dir => '/etc/puppet',
3131
# }
3232
#
3333
class puppet::passenger(
34-
$puppet_passenger_port,
34+
$puppet_proxy_port,
3535
$puppet_docroot,
3636
$apache_serveradmin,
3737
$puppet_conf,
@@ -99,7 +99,7 @@
9999
}
100100

101101
apache::vhost { "puppet-${certname}":
102-
port => $puppet_passenger_port,
102+
port => $puppet_proxy_port,
103103
priority => '40',
104104
docroot => $puppet_docroot,
105105
serveradmin => $apache_serveradmin,

manifests/unicorn.pp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Class: puppet::unicorn
22
#
33
# Parameters:
4-
# - listen_address - IP for binding the nginx
4+
# ['listen_address'] - IP for binding the nginx
5+
# ['puppet_proxy_port'] - The port for the virtual host
56
#
67
# Actions:
78
# - Configures nginx and unicorn for puppet master use. Tested only on CentOS 7
@@ -11,14 +12,16 @@
1112
#
1213
# Sample Usage:
1314
# class {'puppet::unicorn':
14-
# listen_address => '10.250.250.1',
15+
# listen_address => '10.250.250.1',
16+
# puppet_proxy_port => '8140',
1517
# }
1618
#
1719
# written by Tim 'bastelfreak' Meusel
1820
# with big help from Rob 'rnelson0' Nelson
1921

2022
class puppet::unicorn (
2123
$listen_address,
24+
$puppet_proxy_port,
2225
){
2326
include nginx
2427
# install unicorn

spec/classes/puppet_passenger_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
describe 'puppet::passenger', :type => :class do
44
let (:params) do
55
{
6-
:puppet_passenger_port => '8140',
6+
:puppet_proxy_port => '8140',
77
:puppet_docroot => '/etc/puppet/rack/public/',
88
:apache_serveradmin => 'root',
99
:puppet_conf => '/etc/puppet/puppet.conf',

spec/classes/puppet_repo_puppetlabs_spec.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
:lsbdistid => 'Ubuntu'
1111
}
1212
end
13+
let :params do
14+
{
15+
:mirror => 'http://apt.puppetlabs.com',
16+
}
17+
end
1318
it 'should contain puppetlabs apt repos' do
1419
should contain_apt__source('puppetlabs').with(
1520
:repos => 'main',
@@ -31,6 +36,12 @@
3136
:operatingsystem => 'Redhat'
3237
}
3338
end
39+
let :params do
40+
{
41+
:mirror => 'http://yum.puppetlabs.com',
42+
:priority => '1',
43+
}
44+
end
3445
it 'should add the redhat specific repoos' do
3546
should contain_yumrepo('puppetlabs').with(
3647
:baseurl => 'http://yum.puppetlabs.com/el/$releasever/products/$basearch'

templates/puppetmaster

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ server {
2020
proxy_set_header X-Client-DN $ssl_client_s_dn;
2121
proxy_set_header X-SSL-Subject $ssl_client_s_dn;
2222
proxy_set_header X-SSL-Issuer $ssl_client_i_dn;
23-
listen <%= @listen_address %>:8140 ssl;
23+
listen <%= @listen_address %>:<%= @puppet_proxy_port %> ssl;
2424
root /var/empty;
2525
location / {
2626
proxy_pass http://puppetmaster_unicorn;

tests/passenger.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class{ 'puppet::passenger':
2-
puppet_passenger_port => '8140',
2+
puppet_proxy_port => '8140',
33
puppet_docroot => '/etc/puppet/doc',
44
apache_serveradmin => '[email protected]',
55
puppet_site => 'master.example.com',

0 commit comments

Comments
 (0)