From f918bdb0489963a20fe63cecb5b252378ed07f88 Mon Sep 17 00:00:00 2001
From: Jiri Stransky <jistr@redhat.com>
Date: Tue, 7 Jun 2016 12:15:04 +0200
Subject: Allow to manually disable post-puppet restarts

Restarting services after Puppet is vital to ensure that config changes
go applied. However, it can be sometimes desirable to prevent these
restarts to avoid downtime, if the operator is sure that no config
changes need applying. This can be a case e.g. when scaling compute
nodes. Passing the puppet-pacemaker-no-restart.yaml environment file *in
addition* to puppet-pacemaker.yaml should allow this.

This is a stop gap solution before we have proper communication between
Puppet and Pacemaker to allow selective restarts.

Change-Id: I9c3c5c10ed6ecd5489a59d7e320c3c69af9e19f4
---
 extraconfig/tasks/post_puppet_pacemaker.yaml       | 15 ++----------
 .../tasks/post_puppet_pacemaker_restart.yaml       | 28 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 13 deletions(-)
 create mode 100644 extraconfig/tasks/post_puppet_pacemaker_restart.yaml

(limited to 'extraconfig')

diff --git a/extraconfig/tasks/post_puppet_pacemaker.yaml b/extraconfig/tasks/post_puppet_pacemaker.yaml
index fbed9ce5..b62502f8 100644
--- a/extraconfig/tasks/post_puppet_pacemaker.yaml
+++ b/extraconfig/tasks/post_puppet_pacemaker.yaml
@@ -29,20 +29,9 @@ resources:
       config: {get_resource: ControllerPostPuppetMaintenanceModeConfig}
       input_values: {get_param: input_values}
 
-  ControllerPostPuppetRestartConfig:
-    type: OS::Heat::SoftwareConfig
-    properties:
-      group: script
-      config:
-        list_join:
-        - ''
-        - - get_file: pacemaker_common_functions.sh
-          - get_file: pacemaker_resource_restart.sh
-
-  ControllerPostPuppetRestartDeployment:
-    type: OS::Heat::SoftwareDeployments
+  ControllerPostPuppetRestart:
+    type: OS::TripleO::Tasks::ControllerPostPuppetRestart
     depends_on: ControllerPostPuppetMaintenanceModeDeployment
     properties:
       servers:  {get_param: servers}
-      config: {get_resource: ControllerPostPuppetRestartConfig}
       input_values: {get_param: input_values}
diff --git a/extraconfig/tasks/post_puppet_pacemaker_restart.yaml b/extraconfig/tasks/post_puppet_pacemaker_restart.yaml
new file mode 100644
index 00000000..52760c87
--- /dev/null
+++ b/extraconfig/tasks/post_puppet_pacemaker_restart.yaml
@@ -0,0 +1,28 @@
+heat_template_version: 2014-10-16
+description: 'Post-Puppet restart config for Pacemaker deployments'
+
+parameters:
+  servers:
+    type: json
+  input_values:
+     type: json
+     description: input values for the software deployments
+
+resources:
+
+  ControllerPostPuppetRestartConfig:
+    type: OS::Heat::SoftwareConfig
+    properties:
+      group: script
+      config:
+        list_join:
+        - ''
+        - - get_file: pacemaker_common_functions.sh
+          - get_file: pacemaker_resource_restart.sh
+
+  ControllerPostPuppetRestartDeployment:
+    type: OS::Heat::SoftwareDeployments
+    properties:
+      servers:  {get_param: servers}
+      config: {get_resource: ControllerPostPuppetRestartConfig}
+      input_values: {get_param: input_values}
-- 
cgit 1.2.3-korg