Merge "Move UpgradeInitCommand and UpgradeInitCommonCommand to run by Ansible"

This commit is contained in:
Zuul 2019-02-01 19:49:26 +00:00 committed by Gerrit Code Review
commit 1b346b941a
3 changed files with 36 additions and 57 deletions

View File

@ -69,26 +69,6 @@ resources:
software_config_transport: {get_param: software_config_transport} software_config_transport: {get_param: software_config_transport}
deployment_swift_data: {get_param: deployment_swift_data} deployment_swift_data: {get_param: deployment_swift_data}
UpgradeInitConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config:
list_join:
- ''
- - "#!/bin/bash\n\n"
- "if [[ -f /etc/resolv.conf.save ]] ; then rm /etc/resolv.conf.save; fi\n\n"
- get_param: UpgradeInitCommand
- get_param: UpgradeInitCommonCommand
UpgradeInitDeployment:
type: OS::Heat::SoftwareDeployment
properties:
name: UpgradeInitDeployment
server: {get_resource: deployed-server}
config: {get_resource: UpgradeInitConfig}
InstanceIdConfig: InstanceIdConfig:
type: OS::Heat::StructuredConfig type: OS::Heat::StructuredConfig
properties: properties:
@ -102,7 +82,6 @@ resources:
name: InstanceIdDeployment name: InstanceIdDeployment
config: {get_resource: InstanceIdConfig} config: {get_resource: InstanceIdConfig}
server: {get_resource: deployed-server} server: {get_resource: deployed-server}
depends_on: UpgradeInitDeployment
HostsEntryConfig: HostsEntryConfig:
type: OS::Heat::SoftwareConfig type: OS::Heat::SoftwareConfig

View File

@ -51,6 +51,20 @@ parameters:
echo "and passed the upstream name (ocata, pike, queens) of the release as first argument" echo "and passed the upstream name (ocata, pike, queens) of the release as first argument"
exit 1 exit 1
type: string type: string
UpgradeInitCommand:
type: string
description: |
Command or script snippet to run on all overcloud nodes to
initialize the upgrade process. E.g. a repository switch.
default: ''
UpgradeInitCommonCommand:
type: string
description: |
Common commands required by the upgrades process. This should not
normally be modified by the operator and is set and unset in the
major-upgrade-composable-steps.yaml and major-upgrade-converge.yaml
environment files.
default: ''
outputs: outputs:
role_data: role_data:
@ -62,15 +76,29 @@ outputs:
step_config: | step_config: |
include ::tripleo::packages include ::tripleo::packages
upgrade_tasks: upgrade_tasks:
- name: Check yum for rpm-python present - name: Package and repo update tasks
when: step|int == 0 when: step|int == 0
package: "name=rpm-python state=present" block:
register: rpm_python_check - name: Run UpgradeInitCommand
- name: Fail when rpm-python wasn't present shell:
fail: msg="rpm-python package was not present before this run! Check environment before re-running" list_join:
when: - ''
- step|int == 0 - - "#!/bin/bash\n\n"
- rpm_python_check.changed != false - "if [[ -f /etc/resolv.conf.save ]] ; then rm /etc/resolv.conf.save; fi\n\n"
- {get_param: UpgradeInitCommand}
- name: Run UpgradeInitCommonCommand
shell:
list_join:
- ''
- - "#!/bin/bash\n\n"
- {get_param: UpgradeInitCommonCommand}
- name: Check yum for rpm-python present
package: "name=rpm-python state=present"
register: rpm_python_check
- name: Fail when rpm-python wasn't present
fail: msg="rpm-python package was not present before this run! Check environment before re-running"
when:
- rpm_python_check.changed != false
# With the layered product packaging, the key package is rhosp-openvswitch. It depends on # With the layered product packaging, the key package is rhosp-openvswitch. It depends on
# a openvswitch package that includes the version as part of the name (e.g openvswitch2.10). # a openvswitch package that includes the version as part of the name (e.g openvswitch2.10).
# This requires some additional special handling: # This requires some additional special handling:

View File

@ -630,36 +630,8 @@ resources:
- {get_param: NetworkDeploymentActions} - {get_param: NetworkDeploymentActions}
- [] - []
{{server_resource_name}}UpgradeInitConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config:
list_join:
- ''
- - "#!/bin/bash\n\n"
- "if [[ -f /etc/resolv.conf.save ]] ; then rm /etc/resolv.conf.save; fi\n\n"
- get_param: UpgradeInitCommand
- get_param: UpgradeInitCommonCommand
# Note we may be able to make this conditional on UpgradeInitCommandNotEmpty
# but https://bugs.launchpad.net/heat/+bug/1649900 needs fixing first
{{server_resource_name}}UpgradeInitDeployment:
type: OS::Heat::SoftwareDeployment
depends_on: NetworkDeployment
properties:
name: {{server_resource_name}}UpgradeInitDeployment
server: {get_resource: {{server_resource_name}}}
config: {get_resource: {{server_resource_name}}UpgradeInitConfig}
actions:
if:
- server_not_blacklisted
- ['CREATE', 'UPDATE']
- []
{{server_resource_name}}Deployment: {{server_resource_name}}Deployment:
type: OS::Heat::StructuredDeployment type: OS::Heat::StructuredDeployment
depends_on: {{server_resource_name}}UpgradeInitDeployment
properties: properties:
name: {{server_resource_name}}Deployment name: {{server_resource_name}}Deployment
config: {get_resource: {{server_resource_name}}Config} config: {get_resource: {{server_resource_name}}Config}