diff options
author | Steven Hardy <shardy@redhat.com> | 2016-12-14 14:09:36 +0000 |
---|---|---|
committer | Steven Hardy <shardy@redhat.com> | 2016-12-19 11:04:47 +0000 |
commit | c56889100073baa367898093f844e3083fc82f3e (patch) | |
tree | fc92a446570b88170bc7f967e349e6ed087ca836 /puppet/role.role.j2.yaml | |
parent | 58c6988751c6d6b55cfc22aa87bc4f45b6509c2b (diff) |
Move UpgradeInitCommand to role templates
We can't run this during the upgrade steps, because there are things
which need to happen before any role configuration happens, e.g
installing the new hiera heat-config hook, which must be done before
e.g "ControllerDeployment" runs or the stack update hangs.
Partially-Implements: blueprint overcloud-upgrades-per-service
Change-Id: I365b57513590662c3f78a33dc625747f457c48c5
Diffstat (limited to 'puppet/role.role.j2.yaml')
-rw-r--r-- | puppet/role.role.j2.yaml | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/puppet/role.role.j2.yaml b/puppet/role.role.j2.yaml index d0eeed19..1f432773 100644 --- a/puppet/role.role.j2.yaml +++ b/puppet/role.role.j2.yaml @@ -124,6 +124,13 @@ parameters: LoggingGroups: type: comma_delimited_list default: [] + 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: '' + resources: {{role}}: @@ -345,9 +352,30 @@ resources: server: {get_resource: {{role}}} actions: {get_param: NetworkDeploymentActions} + {{role}}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 + + # Note we may be able to make this conditional on UpgradeInitCommandNotEmpty + # but https://bugs.launchpad.net/heat/+bug/1649900 needs fixing first + {{role}}UpgradeInitDeployment: + type: OS::Heat::SoftwareDeployment + depends_on: NetworkDeployment + properties: + name: {{role}}UpgradeInitDeployment + server: {get_resource: {{role}}} + config: {get_resource: {{role}}UpgradeInitConfig} + {{role}}Deployment: type: OS::Heat::StructuredDeployment - depends_on: NetworkDeployment + depends_on: {{role}}UpgradeInitDeployment properties: name: {{role}}Deployment config: {get_resource: {{role}}Config} |