Merge "Enable automatic restart of memcached, apache and mongodb" into stable/newton

This commit is contained in:
Zuul 2018-01-31 06:56:39 +00:00 committed by Gerrit Code Review
commit f30a4696fa
3 changed files with 65 additions and 0 deletions

View File

@ -43,6 +43,26 @@ class tripleo::profile::base::database::mongodb (
include ::tripleo::profile::base::database::mongodbcommon
# Automatic restart
file { '/etc/systemd/system/mongod.service.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
-> file { '/etc/systemd/system/mongod.service.d/mongod.conf':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
content => "[Service]\nRestart=always\n",
}
~> exec { 'mongod-dropin-reload':
command => 'systemctl daemon-reload',
refreshonly => true,
path => $::path,
}
if $bootstrap_node == $::hostname {
# make sure we can connect to all servers before forming the replset
tripleo::profile::pacemaker::database::mongodbvalidator {

View File

@ -99,6 +99,31 @@ class tripleo::profile::base::keystone (
include ::keystone::endpoint
}
# Automatic restart for Apache service
# Note: there is no tripleo-specific file to configure Apache;
# However all OpenStack services that use Apache rely on keystone,
# so generating the drop-in file here is enough to guarantee that
# Apache automatic restart will be enabled on nodes where
# OpenStack API are deployed.
file { '/etc/systemd/system/httpd.service.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
-> file { '/etc/systemd/system/httpd.service.d/httpd.conf':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
content => "[Service]\nRestart=always\n",
}
~> exec { 'httpd-dropin-reload':
command => 'systemctl daemon-reload',
refreshonly => true,
path => $::path,
}
}
if $step >= 5 and $manage_db_purge {

View File

@ -28,5 +28,25 @@ class tripleo::profile::base::memcached (
) {
if $step >= 1 {
include ::memcached
# Automatic restart
file { '/etc/systemd/system/memcached.service.d':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
-> file { '/etc/systemd/system/memcached.service.d/memcached.conf':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
content => "[Service]\nRestart=always\n",
}
~> exec { 'memcached-dropin-reload':
command => 'systemctl daemon-reload',
refreshonly => true,
path => $::path,
}
}
}