Introduce update/upgrade workflow

Change-Id: I7226070aa87416e79f25625647f8e3076c9e2c9a
This commit is contained in:
Jiri Stransky 2016-01-21 13:11:23 +01:00
parent aa5d0120f2
commit 0dd10ffe4f
8 changed files with 80 additions and 8 deletions

View File

@ -1,3 +1,8 @@
resource_registry: resource_registry:
OS::TripleO::Tasks::ControllerPrePuppet: ../extraconfig/tasks/major_upgrade_pacemaker.yaml OS::TripleO::Tasks::UpdateWorkflow: ../extraconfig/tasks/major_upgrade_pacemaker.yaml
OS::TripleO::Tasks::ControllerPostPuppet: ../extraconfig/tasks/noop.yaml OS::TripleO::Tasks::PackageUpdate: ../extraconfig/tasks/yum_update_noop.yaml
OS::TripleO::ControllerPostDeployment: OS::Heat::None
OS::TripleO::ComputePostDeployment: OS::Heat::None
OS::TripleO::ObjectStoragePostDeployment: OS::Heat::None
OS::TripleO::BlockStoragePostDeployment: OS::Heat::None
OS::TripleO::CephStoragePostDeployment: OS::Heat::None

View File

@ -2,7 +2,15 @@ heat_template_version: 2014-10-16
description: 'Upgrade for Pacemaker deployments' description: 'Upgrade for Pacemaker deployments'
parameters: parameters:
servers: controller_servers:
type: json
compute_servers:
type: json
blockstorage_servers:
type: json
objectstorage_servers:
type: json
cephstorage_servers:
type: json type: json
input_values: input_values:
type: json type: json
@ -17,12 +25,12 @@ resources:
list_join: list_join:
- '' - ''
- - get_file: pacemaker_common_functions.sh - - get_file: pacemaker_common_functions.sh
- get_file: major_upgrade_pacemaker_1.sh - get_file: major_upgrade_controller_pacemaker_1.sh
ControllerPacemakerUpgradeDeployment_Step1: ControllerPacemakerUpgradeDeployment_Step1:
type: OS::Heat::SoftwareDeploymentGroup type: OS::Heat::SoftwareDeploymentGroup
properties: properties:
servers: {get_param: servers} servers: {get_param: controller_servers}
config: {get_resource: ControllerPacemakerUpgradeConfig_Step1} config: {get_resource: ControllerPacemakerUpgradeConfig_Step1}
input_values: {get_param: input_values} input_values: {get_param: input_values}
@ -34,12 +42,12 @@ resources:
list_join: list_join:
- '' - ''
- - get_file: pacemaker_common_functions.sh - - get_file: pacemaker_common_functions.sh
- get_file: major_upgrade_pacemaker_2.sh - get_file: major_upgrade_controller_pacemaker_2.sh
ControllerPacemakerUpgrade2Deployment_Step2: ControllerPacemakerUpgradeDeployment_Step2:
type: OS::Heat::SoftwareDeploymentGroup type: OS::Heat::SoftwareDeploymentGroup
depends_on: ControllerPacemakerUpgradeDeployment_Step1 depends_on: ControllerPacemakerUpgradeDeployment_Step1
properties: properties:
servers: {get_param: servers} servers: {get_param: controller_servers}
config: {get_resource: ControllerPacemakerUpgradeConfig_Step2} config: {get_resource: ControllerPacemakerUpgradeConfig_Step2}
input_values: {get_param: input_values} input_values: {get_param: input_values}

View File

@ -4,6 +4,22 @@ description: 'No-op task'
parameters: parameters:
servers: servers:
type: json type: json
default: []
controller_servers:
type: json
default: []
compute_servers:
type: json
default: []
blockstorage_servers:
type: json
default: []
objectstorage_servers:
type: json
default: []
cephstorage_servers:
type: json
default: []
input_values: input_values:
type: json type: json
default: {} default: {}

View File

@ -0,0 +1,29 @@
heat_template_version: 2014-10-16
description: 'No-op yum update task'
resources:
config:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/bash
echo -n "false" > $heat_outputs_path.update_managed_packages
inputs:
- name: update_identifier
description: yum will only run for previously unused values of update_identifier
default: ''
- name: command
description: yum sub-command to run, defaults to "update"
default: update
- name: command_arguments
description: yum command arguments, defaults to ""
default: ''
outputs:
- name: update_managed_packages
description: boolean value indicating whether to upgrade managed packages
outputs:
OS::stack_id:
value: {get_resource: config}

View File

@ -23,6 +23,7 @@ resource_registry:
OS::TripleO::BootstrapNode::SoftwareConfig: puppet/bootstrap-config.yaml OS::TripleO::BootstrapNode::SoftwareConfig: puppet/bootstrap-config.yaml
# Tasks (for internal TripleO usage) # Tasks (for internal TripleO usage)
OS::TripleO::Tasks::UpdateWorkflow: extraconfig/tasks/noop.yaml
OS::TripleO::Tasks::PackageUpdate: extraconfig/tasks/yum_update.yaml OS::TripleO::Tasks::PackageUpdate: extraconfig/tasks/yum_update.yaml
OS::TripleO::Tasks::ControllerPrePuppet: extraconfig/tasks/noop.yaml OS::TripleO::Tasks::ControllerPrePuppet: extraconfig/tasks/noop.yaml
OS::TripleO::Tasks::ControllerPostPuppet: extraconfig/tasks/noop.yaml OS::TripleO::Tasks::ControllerPostPuppet: extraconfig/tasks/noop.yaml

View File

@ -1522,10 +1522,23 @@ resources:
config: {get_resource: AllNodesValidationConfig} config: {get_resource: AllNodesValidationConfig}
servers: {get_attr: [CephStorage, attributes, nova_server_resource]} servers: {get_attr: [CephStorage, attributes, nova_server_resource]}
UpdateWorkflow:
type: OS::TripleO::Tasks::UpdateWorkflow
properties:
controller_servers: {get_attr: [Controller, attributes, nova_server_resource]}
compute_servers: {get_attr: [Compute, attributes, nova_server_resource]}
blockstorage_servers: {get_attr: [BlockStorage, attributes, nova_server_resource]}
objectstorage_servers: {get_attr: [ObjectStorage, attributes, nova_server_resource]}
cephstorage_servers: {get_attr: [CephStorage, attributes, nova_server_resource]}
input_values:
deploy_identifier: {get_param: DeployIdentifier}
update_identifier: {get_param: UpdateIdentifier}
# Optional ExtraConfig for all nodes - all roles are passed in here, but # Optional ExtraConfig for all nodes - all roles are passed in here, but
# the nested template may configure each role differently (or not at all) # the nested template may configure each role differently (or not at all)
AllNodesExtraConfig: AllNodesExtraConfig:
type: OS::TripleO::AllNodesExtraConfig type: OS::TripleO::AllNodesExtraConfig
depends_on: UpdateWorkflow
properties: properties:
controller_servers: {get_attr: [Controller, attributes, nova_server_resource]} controller_servers: {get_attr: [Controller, attributes, nova_server_resource]}
compute_servers: {get_attr: [Compute, attributes, nova_server_resource]} compute_servers: {get_attr: [Compute, attributes, nova_server_resource]}