From e84da28dc310f83ef6ac8ae61ccb4cc5fe6d3c2e Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Thu, 4 Jan 2018 15:27:45 +0100 Subject: [PATCH] Enable automatic restart of memcached, apache and mongodb Prior to Newton, HA deployments had automatic restart of non-Openstack services on controller nodes. From Newton onward, after we switched to systemd for the vast majority of services, Openstack services are configured for automatic restart, but memcached apache and mongodb lack it. Generate a drop-in file for the mentioned services, so they can restart automatically in both HA and non-HA deployments. Change-Id: I8576db193b358cf804e8aaeb0e05b31c635ae5ba Closes-Bug: #1741263 --- manifests/profile/base/apache.pp | 6 ++++++ manifests/profile/base/database/mongodb.pp | 6 ++++++ manifests/profile/base/memcached.pp | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/manifests/profile/base/apache.pp b/manifests/profile/base/apache.pp index b3ae1fffe..a23c1d6f5 100644 --- a/manifests/profile/base/apache.pp +++ b/manifests/profile/base/apache.pp @@ -35,6 +35,12 @@ class tripleo::profile::base::apache( include ::apache::mod::status include ::apache::mod::ssl + # Automatic restart + ::systemd::dropin_file { 'httpd.conf': + unit => 'httpd.service', + content => "[Service]\nRestart=always\n", + } + if $enable_status_listener { if !defined(Apache::Listen[$status_listener]) { ::apache::listen {$status_listener: } diff --git a/manifests/profile/base/database/mongodb.pp b/manifests/profile/base/database/mongodb.pp index 48bdd8260..a21705ad0 100644 --- a/manifests/profile/base/database/mongodb.pp +++ b/manifests/profile/base/database/mongodb.pp @@ -67,5 +67,11 @@ class tripleo::profile::base::database::mongodb ( 'MemoryLimit' => $memory_limit } } + + # Automatic restart + ::systemd::dropin_file { 'mongod.conf': + unit => 'mongod.service', + content => "[Service]\nRestart=always\n", + } } } diff --git a/manifests/profile/base/memcached.pp b/manifests/profile/base/memcached.pp index e33999a12..35a7d1ffe 100644 --- a/manifests/profile/base/memcached.pp +++ b/manifests/profile/base/memcached.pp @@ -28,5 +28,11 @@ class tripleo::profile::base::memcached ( ) { if $step >= 1 { include ::memcached + + # Automatic restart + ::systemd::dropin_file { 'memcached.conf': + unit => 'memcached.service', + content => "[Service]\nRestart=always\n", + } } }