fuel-library/deployment/puppet/tweaks/manifests/apache_wrappers.pp
Vladimir Kuklin 92a4ed5bb8 Add workaround for apache restart during deployment
As figured out in the following launcpad bug
https://bugs.launchpad.net/fuel/+bug/1493353
Apache2 is not very friendly to any types of
restarts. This may lead to the issue when we
restart apache to often during deployment and
it gets into Byzantine unresponsive state
along with keystone which breaks keystone
providers operations.

Change-Id: I11c52089e9598fc6d088c3478c90de3aa853652a
Closes-bug: #1493372
Related-bug: #1493353
2015-09-11 01:07:28 +00:00

19 lines
621 B
Puppet

# Tweak Service httpd or apache2
class tweaks::apache_wrappers (
) {
$service_name = $::osfamily ? {
'RedHat' => 'httpd',
'Debian' => 'apache2',
default => fail("Unsupported osfamily: ${::osfamily}"),
}
# we try a graceful restart but will fall back to a restart if graceful fails
# as we have found that sometimes with mod_wsgi apache will crash on a
# graceful restart - https://github.com/GrahamDumpleton/mod_wsgi/issues/81
Service <| name == $service_name or title == $service_name |> {
restart => 'sleep 30 && apachectl graceful || apachectl restart',
hasrestart => true,
}
}