Function library for major upgrades
authorJiri Stransky <jistr@redhat.com>
Fri, 26 Feb 2016 13:53:29 +0000 (14:53 +0100)
committerJiri Stransky <jistr@redhat.com>
Thu, 3 Mar 2016 13:44:06 +0000 (14:44 +0100)
This commit introduces a bash file to be sourced into major upgrade
scripts. Into this file we can put specific pieces of migration logic in
the form of bash functions, which can then be called from the upgrade
scripts.

Change-Id: Ibf7aa84d3880e9218c488dec9d707300e1784744

extraconfig/tasks/major_upgrade_pacemaker.yaml
extraconfig/tasks/major_upgrade_pacemaker_migrations.sh [new file with mode: 0644]

index 1080fd1..1dc4b0f 100644 (file)
@@ -40,6 +40,7 @@ resources:
               params:
                 UPGRADE_LEVEL_NOVA_COMPUTE: {get_param: UpgradeLevelNovaCompute}
           - get_file: pacemaker_common_functions.sh
+          - get_file: major_upgrade_pacemaker_migrations.sh
           - get_file: major_upgrade_controller_pacemaker_1.sh
 
   ControllerPacemakerUpgradeDeployment_Step1:
@@ -57,6 +58,7 @@ resources:
         list_join:
         - ''
         - - get_file: pacemaker_common_functions.sh
+          - get_file: major_upgrade_pacemaker_migrations.sh
           - get_file: major_upgrade_controller_pacemaker_2.sh
 
   ControllerPacemakerUpgradeDeployment_Step2:
diff --git a/extraconfig/tasks/major_upgrade_pacemaker_migrations.sh b/extraconfig/tasks/major_upgrade_pacemaker_migrations.sh
new file mode 100644 (file)
index 0000000..7fd2694
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# Special pieces of upgrade migration logic go into this
+# file. E.g. Pacemaker cluster transitions for existing deployments,
+# matching changes to overcloud_controller_pacemaker.pp (Puppet
+# handles deployment, this file handles migrations).
+#
+# This file shouldn't execute any action on its own, all logic should
+# be wrapped into bash functions. Upgrade scripts will source this
+# file and call the functions defined in this file where appropriate.
+#
+# The migration functions should be idempotent. If the migration has
+# been already applied, it should be possible to call the function
+# again without damaging the deployment or failing the upgrade.