Refactor upgrade checks.
[apex-tripleo-heat-templates.git] / extraconfig / tasks / major_upgrade_pacemaker.yaml
index c70a954..13f8614 100644 (file)
@@ -26,12 +26,42 @@ parameters:
     constraints:
     - allowed_values: ['auto', 'yes', 'no']
     default: 'auto'
+  IgnoreCephUpgradeWarnings:
+    type: boolean
+    default: false
+    description: If enabled, Ceph upgrade will be forced even though cluster or PGs status is not clean
 
 resources:
   # TODO(jistr): for Mitaka->Newton upgrades and further we can use
   # map_merge with input_values instead of feeding params into scripts
   # via str_replace on bash snippets
 
+  CephMonUpgradeConfig:
+    type: OS::Heat::SoftwareConfig
+    properties:
+      group: script
+      config:
+        list_join:
+        - ''
+        - - str_replace:
+              template: |
+                #!/bin/bash
+                ignore_ceph_upgrade_warnings='IGNORE_CEPH_UPGRADE_WARNINGS'
+              params:
+                IGNORE_CEPH_UPGRADE_WARNINGS: {get_param: IgnoreCephUpgradeWarnings}
+          - get_file: major_upgrade_ceph_mon.sh
+
+  CephMonUpgradeDeployment:
+    type: OS::Heat::SoftwareDeploymentGroup
+    properties:
+      servers: {get_param: controller_servers}
+      config: {get_resource: CephMonUpgradeConfig}
+      input_values: {get_param: input_values}
+      batch_create:
+        max_batch_size: 1
+      rolling_update:
+        max_batch_size: 1
+
   ControllerPacemakerUpgradeConfig_Step1:
     type: OS::Heat::SoftwareConfig
     properties:
@@ -52,11 +82,13 @@ resources:
               params:
                 MYSQL_MAJOR_UPGRADE: {get_param: MySqlMajorUpgrade}
           - get_file: pacemaker_common_functions.sh
+          - get_file: major_upgrade_check.sh
           - get_file: major_upgrade_pacemaker_migrations.sh
           - get_file: major_upgrade_controller_pacemaker_1.sh
 
   ControllerPacemakerUpgradeDeployment_Step1:
     type: OS::Heat::SoftwareDeploymentGroup
+    depends_on: CephMonUpgradeDeployment
     properties:
       servers:  {get_param: controller_servers}
       config: {get_resource: ControllerPacemakerUpgradeConfig_Step1}