@@ -130,108 +130,110 @@ class { 'apache::mod::passenger': }
130
130
# no fedora 18 passenger package yet, and rhel5 packages only exist for ruby 1.8.5
131
131
unless ( fact ( 'operatingsystem' ) == 'Fedora' and fact ( 'operatingsystemrelease' ) . to_f >= 18 ) or ( fact ( 'osfamily' ) == 'RedHat' and fact ( 'operatingsystemmajrelease' ) == '5' and fact ( 'rubyversion' ) != '1.8.5' )
132
132
133
- context "default passenger config" do
134
- it 'succeeds in puppeting passenger' do
135
- pp = <<-EOS
136
- /* EPEL and passenger repositories */
137
- class { 'epel': }
138
- exec { 'passenger.repo GPG key':
139
- command => '/usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
140
- creates => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
141
- }
142
- file { 'passenger.repo GPG key':
143
- ensure => file,
144
- path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
145
- require => Exec['passenger.repo GPG key'],
146
- }
147
- epel::rpm_gpg_key { 'passenger.stealthymonkeys.com':
148
- path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
149
- require => [
150
- Class['epel'],
151
- File['passenger.repo GPG key'],
152
- ]
153
- }
154
- $releasever_string = $operatingsystem ? {
155
- 'Scientific' => '6',
156
- default => '$releasever',
157
- }
158
- yumrepo { 'passenger':
159
- baseurl => "http://passenger.stealthymonkeys.com/rhel/${releasever_string}/\\ $basearch" ,
160
- descr => "Red Hat Enterprise ${releasever_string} - Phusion Passenger",
161
- enabled => 1,
162
- gpgcheck => 1,
163
- gpgkey => 'http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
164
- mirrorlist => 'http://passenger.stealthymonkeys.com/rhel/mirrors',
165
- require => [
166
- Epel::Rpm_gpg_key['passenger.stealthymonkeys.com'],
167
- ],
168
- }
169
- /* apache and mod_passenger */
170
- class { 'apache':
133
+ if fact ( 'operatingsystem' ) == 'RedHat' and fact ( 'operatingsystemmajrelease' ) == '7'
134
+ pending ( 'test passenger - RHEL7 packages don\'t exist' )
135
+ else
136
+ context "default passenger config" do
137
+ it 'succeeds in puppeting passenger' do
138
+ pp = <<-EOS
139
+ /* EPEL and passenger repositories */
140
+ class { 'epel': }
141
+ exec { 'passenger.repo GPG key':
142
+ command => '/usr/bin/curl -o /etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
143
+ creates => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
144
+ }
145
+ file { 'passenger.repo GPG key':
146
+ ensure => file,
147
+ path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
148
+ require => Exec['passenger.repo GPG key'],
149
+ }
150
+ epel::rpm_gpg_key { 'passenger.stealthymonkeys.com':
151
+ path => '/etc/yum.repos.d/RPM-GPG-KEY-stealthymonkeys.asc',
171
152
require => [
172
153
Class['epel'],
173
- ],
174
- }
175
- class { 'apache::mod::passenger':
176
- require => [
177
- Yumrepo['passenger']
178
- ],
179
- }
180
- #{ pp_rackapp }
181
- EOS
182
- apply_manifest ( pp , :catch_failures => true )
183
- end
154
+ File['passenger.repo GPG key'],
155
+ ]
156
+ }
157
+ $releasever_string = $operatingsystem ? {
158
+ 'Scientific' => '6',
159
+ default => '$releasever',
160
+ }
161
+ yumrepo { 'passenger':
162
+ baseurl => "http://passenger.stealthymonkeys.com/rhel/${releasever_string}/\\ $basearch" ,
163
+ descr => "Red Hat Enterprise ${releasever_string} - Phusion Passenger",
164
+ enabled => 1,
165
+ gpgcheck => 1,
166
+ gpgkey => 'http://passenger.stealthymonkeys.com/RPM-GPG-KEY-stealthymonkeys.asc',
167
+ mirrorlist => 'http://passenger.stealthymonkeys.com/rhel/mirrors',
168
+ require => [
169
+ Epel::Rpm_gpg_key['passenger.stealthymonkeys.com'],
170
+ ],
171
+ }
172
+ /* apache and mod_passenger */
173
+ class { 'apache':
174
+ require => [
175
+ Class['epel'],
176
+ ],
177
+ }
178
+ class { 'apache::mod::passenger':
179
+ require => [
180
+ Yumrepo['passenger']
181
+ ],
182
+ }
183
+ #{ pp_rackapp }
184
+ EOS
185
+ apply_manifest ( pp , :catch_failures => true )
186
+ end
184
187
185
- describe service ( service_name ) do
186
- it { should be_enabled }
187
- it { should be_running }
188
- end
188
+ describe service ( service_name ) do
189
+ it { should be_enabled }
190
+ it { should be_running }
191
+ end
189
192
190
- describe file ( conf_file ) do
191
- it { should contain "PassengerRoot #{ passenger_root } " }
192
- it { should contain "PassengerRuby #{ passenger_ruby } " }
193
- it { should contain "PassengerTempDir #{ passenger_tempdir } " }
194
- end
193
+ describe file ( conf_file ) do
194
+ it { should contain "PassengerRoot #{ passenger_root } " }
195
+ it { should contain "PassengerRuby #{ passenger_ruby } " }
196
+ it { should contain "PassengerTempDir #{ passenger_tempdir } " }
197
+ end
195
198
196
- describe file ( load_file ) do
197
- it { should contain "LoadModule passenger_module #{ passenger_module_path } " }
198
- end
199
+ describe file ( load_file ) do
200
+ it { should contain "LoadModule passenger_module #{ passenger_module_path } " }
201
+ end
199
202
200
- it 'should output status via passenger-memory-stats' do
201
- shell ( "/usr/bin/passenger-memory-stats" ) do |r |
202
- r . stdout . should =~ /Apache processes/
203
- r . stdout . should =~ /Nginx processes/
204
- r . stdout . should =~ /Passenger processes/
205
- r . stdout . should =~ /### Processes: [0-9]+/
206
- r . stdout . should =~ /### Total private dirty RSS: [0-9\. ]+ MB/
203
+ it 'should output status via passenger-memory-stats' do
204
+ shell ( "/usr/bin/passenger-memory-stats" ) do |r |
205
+ r . stdout . should =~ /Apache processes/
206
+ r . stdout . should =~ /Nginx processes/
207
+ r . stdout . should =~ /Passenger processes/
208
+ r . stdout . should =~ /### Processes: [0-9]+/
209
+ r . stdout . should =~ /### Total private dirty RSS: [0-9\. ]+ MB/
207
210
208
- r . exit_code . should == 0
211
+ r . exit_code . should == 0
212
+ end
209
213
end
210
- end
211
214
212
- it 'should output status via passenger-status' do
213
- shell ( "PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status" ) do |r |
214
- # spacing may vary
215
- r . stdout . should =~ /[\- ]+ General information [\- ]+/
216
- r . stdout . should =~ /max[ ]+= [0-9]+/
217
- r . stdout . should =~ /count[ ]+= [0-9]+/
218
- r . stdout . should =~ /active[ ]+= [0-9]+/
219
- r . stdout . should =~ /inactive[ ]+= [0-9]+/
220
- r . stdout . should =~ /Waiting on global queue: [0-9]+/
215
+ it 'should output status via passenger-status' do
216
+ shell ( "PASSENGER_TMPDIR=/var/run/rubygem-passenger /usr/bin/passenger-status" ) do |r |
217
+ # spacing may vary
218
+ r . stdout . should =~ /[\- ]+ General information [\- ]+/
219
+ r . stdout . should =~ /max[ ]+= [0-9]+/
220
+ r . stdout . should =~ /count[ ]+= [0-9]+/
221
+ r . stdout . should =~ /active[ ]+= [0-9]+/
222
+ r . stdout . should =~ /inactive[ ]+= [0-9]+/
223
+ r . stdout . should =~ /Waiting on global queue: [0-9]+/
221
224
222
- r . exit_code . should == 0
225
+ r . exit_code . should == 0
226
+ end
223
227
end
224
- end
225
228
226
- it 'should answer to passenger.example.com' do
227
- shell ( "/usr/bin/curl passenger.example.com:80" ) do |r |
228
- r . stdout . should =~ /^hello <b>world<\/ b>$/
229
- r . exit_code . should == 0
229
+ it 'should answer to passenger.example.com' do
230
+ shell ( "/usr/bin/curl passenger.example.com:80" ) do |r |
231
+ r . stdout . should =~ /^hello <b>world<\/ b>$/
232
+ r . exit_code . should == 0
233
+ end
230
234
end
231
235
end
232
236
end
233
-
234
237
end
235
-
236
238
end
237
239
end
0 commit comments