Skip to content

Commit 54bfb3d

Browse files
stephenrjohnsonStephen
authored andcommitted
Merge branch 'make_passenger_tempdir_configurable' of https://github.com/yo61/puppetmodule into yo61-make_passenger_tempdir_configurable
Conflicts: manifests/master.pp Add rake tests and make it so tempdir is only set if we pass a variable. So this doesn't break backward compatibility.
2 parents d019fe5 + 059ca9b commit 54bfb3d

File tree

4 files changed

+47
-12
lines changed

4 files changed

+47
-12
lines changed

manifests/master.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
$puppet_docroot = $::puppet::params::puppet_docroot,
7575
$puppet_vardir = $::puppet::params::puppet_vardir,
7676
$puppet_passenger_port = $::puppet::params::puppet_passenger_port,
77+
$puppet_passenger_tempdir = false,
7778
$puppet_master_package = $::puppet::params::puppet_master_package,
7879
$puppet_master_service = $::puppet::params::puppet_master_service,
7980
$version = 'present',
@@ -132,6 +133,7 @@
132133
conf_dir => $::puppet::params::confdir,
133134
dns_alt_names => join($dns_alt_names,','),
134135
generate_ssl_certs => $generate_ssl_certs,
136+
puppet_passenger_tempdir => $puppet_passenger_tempdir,
135137
} ->
136138
Anchor['puppet::master::end']
137139

manifests/passenger.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
class puppet::passenger(
3535
$generate_ssl_certs = true,
3636
$puppet_passenger_port,
37+
$puppet_passenger_tempdir = false,
3738
$puppet_docroot,
3839
$apache_serveradmin,
3940
$puppet_conf,

spec/classes/puppet_passenger_spec.rb

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
:group => 'puppet',
4444
:mode => '0755'
4545
)
46+
should contain_file('puppet_passenger.conf').with(
47+
:ensure => 'file',
48+
)
49+
should contain_file('puppet_passenger.conf').without_content(/PassengerTempDir/)
4650
should contain_file('/etc/puppet/rack').with(
4751
:ensure => 'directory',
4852
:owner => 'puppet',
@@ -74,17 +78,43 @@
7478
}
7579
end
7680
context 'on Redhat' do
77-
let(:facts) do
78-
{
79-
:osfamily => 'Redhat',
80-
:operatingsystem => 'Redhat',
81-
:operatingsystemrelease => '5',
82-
:concat_basedir => '/dne',
83-
}
84-
end
85-
it {
86-
should contain_file('/var/lib/puppet/reports')
87-
should contain_file('/var/lib/puppet/ssl/ca/requests')
81+
let(:facts) do
82+
{
83+
:osfamily => 'Redhat',
84+
:operatingsystem => 'Redhat',
85+
:operatingsystemrelease => '5',
86+
:concat_basedir => '/dne',
87+
}
88+
end
89+
it {
90+
should contain_file('/var/lib/puppet/reports')
91+
should contain_file('/var/lib/puppet/ssl/ca/requests')
92+
}
93+
end
94+
context 'on Redhat with tempdir' do
95+
let(:facts) do
96+
{
97+
:osfamily => 'Redhat',
98+
:operatingsystem => 'Redhat',
99+
:operatingsystemrelease => '5',
100+
:concat_basedir => '/dne',
101+
}
102+
end
103+
let (:params) do
104+
{
105+
:puppet_passenger_port => '8140',
106+
:puppet_docroot => '/etc/puppet/rack/public/',
107+
:apache_serveradmin => 'root',
108+
:puppet_conf => '/etc/puppet/puppet.conf',
109+
:puppet_ssldir => '/var/lib/puppet/ssl',
110+
:certname => 'test.test.com',
111+
:conf_dir => '/etc/puppet',
112+
:dns_alt_names => ['puppet'],
113+
:puppet_passenger_tempdir => '/tmp/passenger',
88114
}
115+
end
116+
it {
117+
should contain_file('puppet_passenger.conf').with_content(/PassengerTempDir/)
118+
}
89119
end
90120
end

templates/puppet_passenger.conf.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ PassengerPoolIdleTime 1500
44
PassengerStatThrottleRate 120
55
RackAutoDetect Off
66
RailsAutoDetect Off
7-
PassengerTempDir /var/run/rubygem-passenger
7+
<% if puppet_passenger_tempdir != false %>
8+
PassengerTempDir <%= @puppet_passenger_tempdir %>
9+
<% end %>

0 commit comments

Comments
 (0)