From 584d2f0eea96c773741f752cbaaeaecb71c00bed Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Thu, 21 Jul 2016 11:03:54 +0200 Subject: [PATCH] Add ordering constraints between Apache and VIPs This ensures that the Nagios Apache service won't start until the VIP interfaces are up and running. This is required because the Apache OCF script needs to tweak the ARP parameters of the VIP interfaces. Change-Id: I4cc7b7db06cda31064b22e0283af478228202b54 Related-Bug: #1594722 --- deployment_scripts/puppet/manifests/nagios.pp | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/deployment_scripts/puppet/manifests/nagios.pp b/deployment_scripts/puppet/manifests/nagios.pp index 5d1b9ce..bba2b90 100644 --- a/deployment_scripts/puppet/manifests/nagios.pp +++ b/deployment_scripts/puppet/manifests/nagios.pp @@ -170,6 +170,21 @@ if $fuel_version < 9.0 { require => [File['ocf-ns_apache'], Exec['net.ipv4.ip_nonlocal_bind'], Class['lma_infra_alerting::nagios']], } + # Apache needs to start after the VIP interfaces are up and running + cs_rsc_order { 'apache2-nagios-after-mgmt-vip': + ensure => present, + first => 'vip__infrastructure_alerting_mgmt_vip', + second => 'apache2-nagios', + require => Cs_resource['apache2-nagios'], + } + + cs_rsc_order { 'apache2-nagios-after-ui-vip': + ensure => present, + first => 'vip__infrastructure_alerting_ui', + second => 'apache2-nagios', + require => Cs_resource['apache2-nagios'], + } + cs_rsc_colocation { 'infrastructure_alerting_vip-with-apache2-nagios': ensure => present, score => 'INFINITY', @@ -215,7 +230,7 @@ if $fuel_version < 9.0 { } # The two VIPs must be colocated - # This assumes that the VIPs have already been created + # It assumes that the VIPs have already been created at a previous stage cs_rsc_colocation { 'ui_vip-with-wsgi_vip': ensure => present, score => 'INFINITY', @@ -258,6 +273,21 @@ if $fuel_version < 9.0 { require => Pacemaker::Service['apache2-nagios'], } + # Apache needs to start after the VIP interfaces are up and running + pcmk_order { 'apache2-nagios-after-mgmt-vip': + ensure => present, + first => 'vip__infrastructure_alerting_mgmt_vip', + second => 'apache2-nagios', + require => Pacemaker::Service['apache2-nagios'], + } + + pcmk_order { 'apache2-nagios-after-ui-vip': + ensure => present, + first => 'vip__infrastructure_alerting_ui', + second => 'apache2-nagios', + require => Pacemaker::Service['apache2-nagios'], + } + # Nagios resources for Pacemaker pacemaker::service { 'nagios3': primitive_type => 'ocf-ns_nagios', @@ -291,7 +321,7 @@ if $fuel_version < 9.0 { } # The two VIPs must be colocated - # This assumes VIPs are already created + # It assumes that the VIPs have already been created at a previous stage pcmk_colocation { 'ui_vip-with-wsgi_vip': ensure => present, score => 'INFINITY',