Only set the stonith property on the pacemaker_master node
authorMichele Baldessari <michele@acksyn.org>
Wed, 7 Jun 2017 08:20:25 +0000 (10:20 +0200)
committerMichele Baldessari <michele@acksyn.org>
Wed, 14 Jun 2017 07:01:26 +0000 (09:01 +0200)
It makes little sense to enforce the stonith property on remote nodes and/or
all cluster nodes. We can just enforce it once on the pacemaker_master
node as it is a cluster-wide property anyway. We can also remove the
tripleo::fencing -> pacemaker::stonith constraint in the pacemaker
remote profile now as the fencing stuff happens on step 5 anyway and
the property is set at step 1.

While this works in general it creates extra CIB changes for nothing and
slows down the deployment.

Change-Id: Ifef08033043a4cc90a6261e962d2fdecdf275650
Closes-Bug: #1696336

manifests/profile/base/pacemaker.pp
manifests/profile/base/pacemaker_remote.pp

index 811b911..bd92c98 100644 (file)
@@ -111,9 +111,11 @@ class tripleo::profile::base::pacemaker (
       cluster_setup_extras => $cluster_setup_extras,
       remote_authkey       => $remote_authkey,
     }
-    class { '::pacemaker::stonith':
-      disable => !$enable_fencing,
-      tries   => $pcs_tries,
+    if $pacemaker_master {
+      class { '::pacemaker::stonith':
+        disable => !$enable_fencing,
+        tries   => $pcs_tries,
+      }
     }
     if $enable_fencing {
       include ::tripleo::fencing
index dfe0a3e..8264132 100644 (file)
@@ -46,11 +46,6 @@ class tripleo::profile::base::pacemaker_remote (
   }
   $enable_fencing_real = str2bool($enable_fencing) and $step >= 5
 
-  class { '::pacemaker::stonith':
-    disable => !$enable_fencing_real,
-    tries   => $pcs_tries,
-  }
-
   if $enable_fencing_real {
     include ::tripleo::fencing
 
@@ -58,7 +53,5 @@ class tripleo::profile::base::pacemaker_remote (
     Pcmk_resource<||> -> Class['tripleo::fencing']
     Pcmk_constraint<||> -> Class['tripleo::fencing']
     Exec <| tag == 'pacemaker_constraint' |> -> Class['tripleo::fencing']
-    # enable stonith after all fencing devices have been created
-    Class['tripleo::fencing'] -> Class['pacemaker::stonith']
   }
 }