Browse Source

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
Simon Pasquier 2 years ago
parent
commit
584d2f0eea
1 changed files with 32 additions and 2 deletions
  1. 32
    2
      deployment_scripts/puppet/manifests/nagios.pp

+ 32
- 2
deployment_scripts/puppet/manifests/nagios.pp View File

@@ -170,6 +170,21 @@ if $fuel_version < 9.0 {
170 170
     require        => [File['ocf-ns_apache'], Exec['net.ipv4.ip_nonlocal_bind'], Class['lma_infra_alerting::nagios']],
171 171
   }
172 172
 
173
+  # Apache needs to start after the VIP interfaces are up and running
174
+  cs_rsc_order { 'apache2-nagios-after-mgmt-vip':
175
+    ensure  => present,
176
+    first   => 'vip__infrastructure_alerting_mgmt_vip',
177
+    second  => 'apache2-nagios',
178
+    require => Cs_resource['apache2-nagios'],
179
+  }
180
+
181
+  cs_rsc_order { 'apache2-nagios-after-ui-vip':
182
+    ensure  => present,
183
+    first   => 'vip__infrastructure_alerting_ui',
184
+    second  => 'apache2-nagios',
185
+    require => Cs_resource['apache2-nagios'],
186
+  }
187
+
173 188
   cs_rsc_colocation { 'infrastructure_alerting_vip-with-apache2-nagios':
174 189
     ensure     => present,
175 190
     score      => 'INFINITY',
@@ -215,7 +230,7 @@ if $fuel_version < 9.0 {
215 230
   }
216 231
 
217 232
   # The two VIPs must be colocated
218
-  # This assumes that the VIPs have already been created
233
+  # It assumes that the VIPs have already been created at a previous stage
219 234
   cs_rsc_colocation { 'ui_vip-with-wsgi_vip':
220 235
     ensure     => present,
221 236
     score      => 'INFINITY',
@@ -258,6 +273,21 @@ if $fuel_version < 9.0 {
258 273
     require => Pacemaker::Service['apache2-nagios'],
259 274
   }
260 275
 
276
+  # Apache needs to start after the VIP interfaces are up and running
277
+  pcmk_order { 'apache2-nagios-after-mgmt-vip':
278
+    ensure  => present,
279
+    first   => 'vip__infrastructure_alerting_mgmt_vip',
280
+    second  => 'apache2-nagios',
281
+    require => Pacemaker::Service['apache2-nagios'],
282
+  }
283
+
284
+  pcmk_order { 'apache2-nagios-after-ui-vip':
285
+    ensure  => present,
286
+    first   => 'vip__infrastructure_alerting_ui',
287
+    second  => 'apache2-nagios',
288
+    require => Pacemaker::Service['apache2-nagios'],
289
+  }
290
+
261 291
   # Nagios resources for Pacemaker
262 292
   pacemaker::service { 'nagios3':
263 293
     primitive_type => 'ocf-ns_nagios',
@@ -291,7 +321,7 @@ if $fuel_version < 9.0 {
291 321
   }
292 322
 
293 323
   # The two VIPs must be colocated
294
-  # This assumes VIPs are already created
324
+  # It assumes that the VIPs have already been created at a previous stage
295 325
   pcmk_colocation { 'ui_vip-with-wsgi_vip':
296 326
     ensure => present,
297 327
     score  => 'INFINITY',

Loading…
Cancel
Save