Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Commit 5d07998

Browse files
committed
Merge pull request #366 from andrewklau/foreman_fixes
Clean up to avoid unnecessary notices and service restarts
2 parents 67331b8 + d598d30 commit 5d07998

File tree

5 files changed

+52
-29
lines changed

5 files changed

+52
-29
lines changed

manifests/broker.pp

+23-11
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@
104104
'/var/www/openshift/broker/httpd/run',
105105
'/var/www/openshift/broker/tmp',
106106
'/var/www/openshift/broker/tmp/cache',
107+
'/var/www/openshift/broker/tmp/sessions',
108+
'/var/www/openshift/broker/tmp/pids',
109+
'/var/www/openshift/broker/tmp/sockets',
107110
]:
108111
ensure => directory,
109112
}
@@ -192,6 +195,12 @@
192195
$quickstart_content = ''
193196
}
194197

198+
exec {'clear console cache':
199+
refreshonly => true,
200+
subscribe => File['quickstarts'],
201+
command => 'oo-admin-console-cache --clear',
202+
}
203+
195204
file { 'quickstarts':
196205
ensure => present,
197206
path => '/etc/openshift/quickstarts.json',
@@ -248,29 +257,32 @@
248257
$broker_bundle_show = 'LD_LIBRARY_PATH=/opt/rh/ruby193/root/usr/lib64 GEM_PATH=/opt/rh/ruby193/root/usr/local/share/gems:/opt/rh/ruby193/root/usr/share/gems /opt/rh/ruby193/root/usr/bin/bundle show'
249258

250259
exec { 'Broker gem dependencies':
251-
cwd => '/var/www/openshift/broker/',
252-
command => "rm -f Gemfile.lock && ${broker_bundle_show}",
253-
before => File['/var/www/openshift/broker/tmp'],
254-
require => [
260+
cwd => '/var/www/openshift/broker/',
261+
command => "rm -f Gemfile.lock && ${broker_bundle_show}",
262+
before => File['/var/www/openshift/broker/tmp'],
263+
require => [
255264
Package['openshift-origin-broker'],
256265
File['openshift broker.conf','mcollective broker plugin config'],
257266
],
258-
notify => [
267+
notify => [
259268
Service['openshift-broker'],
260269
File['/var/www/openshift/broker/Gemfile.lock'],
261270
],
271+
subscribe => Package['openshift-origin-broker'],
272+
refreshonly => true,
262273
}
263274

264275
# This File resource is to guarantee that the Gemfile.lock created
265276
# by the subscribed Exec has the appropriate permissions (otherwise
266277
# it is created as owned by root:root)
267278
file { '/var/www/openshift/broker/Gemfile.lock':
268-
ensure => present,
269-
owner => 'apache',
270-
group => 'apache',
271-
mode => '0644',
272-
require => Package['openshift-origin-broker','httpd'],
273-
subscribe => Exec['Broker gem dependencies'],
279+
ensure => present,
280+
owner => 'apache',
281+
group => 'apache',
282+
mode => '0644',
283+
selinux_ignore_defaults => true,
284+
require => Package['openshift-origin-broker','httpd'],
285+
subscribe => Exec['Broker gem dependencies'],
274286
}
275287

276288
service { 'openshift-broker':

manifests/cartridges/jenkins.pp

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
require => Class['openshift_origin::install_method'],
1919
}
2020
exec { '/usr/bin/yum versionlock jenkins':
21-
require => Package['jenkins', 'yum-plugin-versionlock'],
21+
require => Package['jenkins', 'yum-plugin-versionlock'],
22+
subscribe => Package['jenkins'],
23+
refreshonly => true,
2224
}
2325
}

manifests/console.pp

+11-9
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@
112112
# by the following Exec has the appropriate permissions (otherwise
113113
# it is created as owned by root:root)
114114
file { '/var/www/openshift/console/Gemfile.lock':
115-
ensure => 'present',
116-
owner => 'apache',
117-
group => 'apache',
118-
mode => '0644',
119-
require => Package['openshift-origin-console','httpd'],
115+
ensure => 'present',
116+
owner => 'apache',
117+
group => 'apache',
118+
mode => '0644',
119+
selinux_ignore_defaults => true,
120+
require => Package['openshift-origin-console','httpd'],
120121
}
121122

122123
# SCL and Puppet don't play well together; the 'default' here
@@ -143,10 +144,11 @@
143144
}
144145

145146
exec { 'restorecon console dir':
146-
command => 'restorecon -R /var/www/openshift/console',
147-
provider => 'shell',
148-
require => Package['openshift-origin-console'],
149-
notify => Service['openshift-console'],
147+
command => 'restorecon -R /var/www/openshift/console',
148+
provider => 'shell',
149+
require => Package['openshift-origin-console'],
150+
notify => Service['openshift-console'],
151+
refreshonly => true,
150152
}
151153

152154
service { 'openshift-console':

manifests/selbooleans/broker_console.pp

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
persistent => true,
1515
}
1616
exec { 'Broker / Console restorecon commands':
17-
command => template('openshift_origin/selinux/broker_console_restorecons.erb'),
18-
require => Package['openshift-origin-broker','openshift-origin-console'],
19-
notify => Service['openshift-broker'],
20-
timeout => 1800,
17+
command => template('openshift_origin/selinux/broker_console_restorecons.erb'),
18+
subscribe => Package['openshift-origin-broker','openshift-origin-console'],
19+
require => Package['openshift-origin-broker','openshift-origin-console'],
20+
notify => Service['openshift-broker'],
21+
timeout => 1800,
22+
refreshonly => true,
2123
}
2224
}

manifests/selbooleans/node.pp

+9-4
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@
99
persistent => true,
1010
}
1111
exec { 'node restorecon commands':
12-
command => 'restorecon -rv /var/run; restorecon -rv /var/lib/openshift /etc/openshift/node.conf',
13-
timeout => 1800,
14-
require => [
12+
command => 'restorecon -rv /var/run; restorecon -rv /var/lib/openshift /etc/openshift/node.conf',
13+
timeout => 1800,
14+
refreshonly => true,
15+
subscribe => [
1516
Package['rubygem-openshift-origin-node'],
1617
File['openshift node config'],
17-
]
18+
],
19+
require => [
20+
Package['rubygem-openshift-origin-node'],
21+
File['openshift node config'],
22+
],
1823
}
1924
}

0 commit comments

Comments
 (0)