Always start httpd at the same time

Puppet wipes out whatever is not in it's resource catalog each run for
httpd. This causes httpd to restart if in the next step there are
reasources added that were not there earlier.

This patch, thus changes the instances of httpd to start at the same
time: On step 3 for the bootstrap node, and on step 4 for every other
node.

 Conflicts:
	manifests/profile/base/heat/api.pp
	manifests/profile/base/heat/api_cfn.pp
	manifests/profile/base/heat/api_cloudwatch.pp
	manifests/profile/base/horizon.pp
	manifests/profile/base/zaqar.pp

Closes-Bug: #1699502
Change-Id: I3d29728c1ab7bd5b78100f89e00e5fa082f97b0c
Co-Authored-By: Alex Schultz <aschultz@redhat.com>
(cherry picked from commit ad14f23c11)
This commit is contained in:
Juan Antonio Osorio Robles 2017-06-21 15:43:25 +03:00
parent 3d67149de1
commit ff56fb5110
12 changed files with 170 additions and 21 deletions

View File

@ -23,6 +23,10 @@
# This is set by t-h-t.
# Defaults to hiera('aodh_api_network', undef)
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
# [*certificates_specs*]
# (Optional) The specifications to give to certmonger for the certificate(s)
# it will create.
@ -55,11 +59,17 @@
class tripleo::profile::base::aodh::api (
$aodh_network = hiera('aodh_api_network', undef),
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$certificates_specs = hiera('apache_certificates_specs', {}),
$enable_internal_tls = hiera('enable_internal_tls', false),
$generate_service_certificates = hiera('generate_service_certificates', false),
$step = hiera('step'),
) {
if $::hostname == downcase($bootstrap_node) {
$is_bootstrap = true
} else {
$is_bootstrap = false
}
include ::tripleo::profile::base::aodh
@ -79,7 +89,7 @@ class tripleo::profile::base::aodh::api (
}
if $step >= 3 {
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
include ::aodh::api
include ::apache::mod::ssl
class { '::aodh::wsgi::apache':

View File

@ -23,6 +23,10 @@
# This is set by t-h-t.
# Defaults to hiera('ceilometer_api_network', undef)
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
# [*certificates_specs*]
# (Optional) The specifications to give to certmonger for the certificate(s)
# it will create.
@ -53,12 +57,19 @@
# Defaults to hiera('step')
#
class tripleo::profile::base::ceilometer::api (
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$ceilometer_network = hiera('ceilometer_api_network', undef),
$certificates_specs = hiera('apache_certificates_specs', {}),
$enable_internal_tls = hiera('enable_internal_tls', false),
$generate_service_certificates = hiera('generate_service_certificates', false),
$step = hiera('step'),
) {
if $::hostname == downcase($bootstrap_node) {
$is_bootstrap = true
} else {
$is_bootstrap = false
}
include ::tripleo::profile::base::ceilometer
if $enable_internal_tls {
@ -76,7 +87,7 @@ class tripleo::profile::base::ceilometer::api (
$tls_keyfile = undef
}
if $step >= 3 {
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
include ::ceilometer::api
include ::apache::mod::ssl
class { '::ceilometer::wsgi::apache':

View File

@ -18,17 +18,28 @@
#
# === Parameters
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
class tripleo::profile::base::heat::api (
$step = hiera('step'),
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$step = hiera('step'),
) {
if $::hostname == downcase($bootstrap_node) {
$is_bootstrap = true
} else {
$is_bootstrap = false
}
include ::tripleo::profile::base::heat
if $step >= 4 {
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
include ::heat::api
}
}

View File

@ -18,17 +18,28 @@
#
# === Parameters
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
class tripleo::profile::base::heat::api_cfn (
$step = hiera('step'),
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$step = hiera('step'),
) {
if $::hostname == downcase($bootstrap_node) {
$is_bootstrap = true
} else {
$is_bootstrap = false
}
include ::tripleo::profile::base::heat
if $step >= 4 {
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
include ::heat::api_cfn
}
}

View File

@ -18,17 +18,28 @@
#
# === Parameters
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
# Defaults to hiera('step')
#
class tripleo::profile::base::heat::api_cloudwatch (
$step = hiera('step'),
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$step = hiera('step'),
) {
if $::hostname == downcase($bootstrap_node) {
$is_bootstrap = true
} else {
$is_bootstrap = false
}
include ::tripleo::profile::base::heat
if $step >= 4 {
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
include ::heat::api_cloudwatch
}
}

View File

@ -23,10 +23,21 @@
# for more details.
# Defaults to hiera('step')
#
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
class tripleo::profile::base::horizon (
$step = hiera('step'),
$step = hiera('step'),
$bootstrap_node = hiera('bootstrap_nodeid', undef),
) {
if $step >= 3 {
if $::hostname == downcase($bootstrap_node) {
$is_bootstrap = true
} else {
$is_bootstrap = false
}
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
# Horizon
include ::apache::mod::remoteip
include ::apache::mod::status

View File

@ -63,9 +63,9 @@ class tripleo::profile::base::nova::placement (
$step = hiera('step'),
) {
if $::hostname == downcase($bootstrap_node) {
$sync_db = true
$is_bootstrap = true
} else {
$sync_db = false
$is_bootstrap = false
}
include ::tripleo::profile::base::nova
@ -85,7 +85,7 @@ class tripleo::profile::base::nova::placement (
$tls_keyfile = undef
}
if $step >= 3 {
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
include ::apache::mod::ssl
class { '::nova::wsgi::apache_placement':
ssl_cert => $tls_certfile,

View File

@ -18,9 +18,9 @@
#
# === Parameters
#
# [*sync_db*]
# (Optional) Whether to run db sync
# Defaults to true
# [*bootstrap_node*]
# (Optional) The hostname of the node responsible for bootstrapping tasks
# Defaults to hiera('bootstrap_nodeid')
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
@ -28,9 +28,16 @@
# Defaults to hiera('step')
#
class tripleo::profile::base::zaqar (
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$step = hiera('step'),
) {
if $step >= 4 {
if $::hostname == downcase($bootstrap_node) {
$is_bootstrap = true
} else {
$is_bootstrap = false
}
if $step >= 4 or ( $step >= 3 and $is_bootstrap ) {
include ::zaqar
if str2bool(hiera('mongodb::server::ipv6', false)) {

View File

@ -0,0 +1,5 @@
---
fixes:
- In order to avoid service restarts, all services deploy their httpd
configuration at the same time. Thus, httpd now starts in step 3 for the
bootstrap nodes, and step 4 for all other nodes.

View File

@ -33,11 +33,34 @@ describe 'tripleo::profile::base::aodh::api' do
end
end
context 'with step 3' do
context 'with step 3 and not bootstrap' do
let(:params) { {
:step => 3,
} }
it 'should trigger complete configuration' do
is_expected.not_to contain_class('aodh::api')
is_expected.not_to contain_class('aodh::wsgi::apache')
end
end
context 'with step 3 and bootstrap' do
let(:params) { {
:step => 3,
:bootstrap_node => 'node.example.com'
} }
it 'should trigger complete configuration' do
is_expected.to contain_class('aodh::api')
is_expected.to contain_class('aodh::wsgi::apache')
end
end
context 'with step 4' do
let(:params) { {
:step => 4,
} }
it 'should trigger complete configuration' do
is_expected.to contain_class('aodh::api')
is_expected.to contain_class('aodh::wsgi::apache')

View File

@ -32,9 +32,32 @@ describe 'tripleo::profile::base::ceilometer::api' do
end
end
context 'with step 3' do
context 'with step 3 and not bootstrap' do
let(:params) { {
:step => 3,
:step => 3,
} }
it 'should trigger complete configuration' do
is_expected.not_to contain_class('ceilometer::api')
is_expected.not_to contain_class('ceilometer::wsgi::apache')
end
end
context 'with step 3 and bootstrap' do
let(:params) { {
:step => 3,
:bootstrap_node => 'node.example.com'
} }
it 'should trigger complete configuration' do
is_expected.to contain_class('ceilometer::api')
is_expected.to contain_class('ceilometer::wsgi::apache')
end
end
context 'with step 4' do
let(:params) { {
:step => 4,
} }
it 'should trigger complete configuration' do

View File

@ -31,11 +31,37 @@ describe 'tripleo::profile::base::horizon' do
end
end
context 'with step 3' do
context 'with step 3 and not bootstrap' do
let(:params) { {
:step => 3,
} }
it 'should not configure anything' do
is_expected.to_not contain_class('horizon')
is_expected.to_not contain_class('apache::mod::remoteip')
is_expected.to_not contain_class('apache::mod::status')
end
end
context 'with step 3 and bootstrap' do
let(:params) { {
:step => 3,
:bootstrap_node => 'node.example.com'
} }
it 'should trigger complete configuration' do
is_expected.to contain_class('horizon')
is_expected.to contain_class('apache::mod::remoteip')
is_expected.to contain_class('apache::mod::status')
end
end
context 'with step 4' do
let(:params) { {
:step => 3,
:bootstrap_node => 'node.example.com'
} }
it 'should trigger complete configuration' do
is_expected.to contain_class('horizon')
is_expected.to contain_class('apache::mod::remoteip')