Disable puppet on upgrade for roles not upgrading

Where the role has disabled upgrades, we need to skip both the ansible and
puppet steps.  To do this we refactor the post.j2.yaml so that it can be
included in the upgrade template with an adjusted list of roles.

Note this requires https://review.openstack.org/#/c/425220/ - this
change will be required for local testing of this patch
(run mistral-db-mange populate after updating tripleo-common
and restart the mistral services, or update your repos and re-run
openstack undercloud install).

Partially-Implements: blueprint overcloud-upgrades-per-service
Change-Id: Ie7d0fa6fef3528bd93e6cde076b964ea8de3185a
changes/05/424905/12
Steven Hardy 6 years ago
parent ec24ed7dd8
commit 87af02d673
  1. 8
      environments/major-upgrade-all-in-one.yaml
  2. 3
      environments/major-upgrade-composable-steps.yaml
  3. 2
      overcloud-resource-registry-puppet.j2.yaml
  4. 20
      overcloud.j2.yaml
  5. 14
      puppet/major_upgrade_steps.j2.yaml
  6. 27
      puppet/post-upgrade.j2.yaml
  7. 90
      puppet/post.j2.yaml
  8. 88
      puppet/puppet-steps.j2

@ -1,8 +1,2 @@
# We run the upgrade steps without disabling the OS::TripleO::PostDeploySteps
# this means you can do a major upgrade in one pass, which may be useful
# e.g for all-in-one deployments where we can upgrade the compute services
# at the same time as the controlplane
# Note that it will be necessary to pass a mapping of OS::Heat::None again for
# any subsequent updates, or the upgrade steps will run again.
resource_registry:
OS::TripleO::UpgradeSteps: ../puppet/major_upgrade_steps.yaml
OS::TripleO::PostDeploySteps: ../puppet/major_upgrade_steps.yaml

@ -1,3 +1,2 @@
resource_registry:
OS::TripleO::UpgradeSteps: ../puppet/major_upgrade_steps.yaml
OS::TripleO::PostDeploySteps: OS::Heat::None
OS::TripleO::PostDeploySteps: ../puppet/major_upgrade_steps.yaml

@ -2,6 +2,7 @@ resource_registry:
OS::TripleO::SoftwareDeployment: OS::Heat::StructuredDeployment
OS::TripleO::PostDeploySteps: puppet/post.yaml
OS::TripleO::PostUpgradeSteps: puppet/post.yaml
OS::TripleO::AllNodes::SoftwareConfig: puppet/all-nodes-config.yaml
OS::TripleO::Hosts::SoftwareConfig: hosts-config.yaml
OS::TripleO::DefaultPasswords: default_passwords.yaml
@ -110,7 +111,6 @@ resource_registry:
# Upgrade resources
OS::TripleO::UpgradeConfig: puppet/upgrade_config.yaml
OS::TripleO::UpgradeSteps: OS::Heat::None
# services
OS::TripleO::Services: puppet/services/services.yaml

@ -598,9 +598,9 @@ resources:
{{role.name}}: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
{% endfor %}
# Upgrade steps for all roles
AllNodesUpgradeSteps:
type: OS::TripleO::UpgradeSteps
# Post deployment steps for all roles
AllNodesDeploySteps:
type: OS::TripleO::PostDeploySteps
depends_on:
{% for role in roles %}
- {{role.name}}AllNodesDeployment
@ -615,20 +615,6 @@ resources:
{{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data]}
{% endfor %}
# Post deployment steps for all roles
AllNodesDeploySteps:
type: OS::TripleO::PostDeploySteps
depends_on: AllNodesUpgradeSteps
properties:
servers:
{% for role in roles %}
{{role.name}}: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
{% endfor %}
role_data:
{% for role in roles %}
{{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data]}
{% endfor %}
outputs:
ManagedEndpoints:
description: Asserts that the keystone endpoints have been provisioned.

@ -1,4 +1,5 @@
{% set upgrade_steps_max = 8 -%}
{% set enabled_roles = roles|rejectattr('disable_upgrade_deployment')|list -%}
heat_template_version: ocata
description: 'Upgrade steps for all roles'
@ -135,6 +136,19 @@ resources:
{% endfor %}
{% endfor %}
# Post upgrade deployment steps for all roles
# This runs the normal configuration (e.g puppet) steps unless upgrade
# is disabled for the role
AllNodesPostUpgradeSteps:
type: OS::TripleO::PostUpgradeSteps
depends_on:
{%- for dep in enabled_roles %}
- {{dep.name}}Upgrade_Step{{upgrade_steps_max - 1}}
{%- endfor %}
properties:
servers: {get_param: servers}
role_data: {get_param: role_data}
outputs:
# Output the config for each role, just use Step1 as the config should be
# the same for all steps (only the tag provided differs)

@ -0,0 +1,27 @@
heat_template_version: ocata
description: >
Post-upgrade configuration steps via puppet for all roles
where upgrade is not disabled as defined in ../roles_data.yaml
parameters:
servers:
type: json
description: Mapping of Role name e.g Controller to a list of servers
role_data:
type: json
description: Mapping of Role name e.g Controller to the per-role data
DeployIdentifier:
default: ''
type: string
description: >
Setting this to a unique value will re-run any deployment tasks which
perform configuration on a Heat stack-update.
resources:
# Note the include here is the same as post.j2.yaml but the data used at
# the time of rendering is different if any roles disable upgrades
{% set roles = roles|rejectattr('disable_upgrade_deployment')|list -%}
{% include 'puppet-steps.j2' %}

@ -21,92 +21,4 @@ parameters:
perform configuration on a Heat stack-update.
resources:
# Post deployment steps for all roles
# A single config is re-applied with an incrementing step number
{% for role in roles %}
# {{role.name}} Role post deploy steps
{{role.name}}ArtifactsConfig:
type: deploy-artifacts.yaml
{{role.name}}ArtifactsDeploy:
type: OS::Heat::StructuredDeployments
properties:
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}ArtifactsConfig}
{{role.name}}PreConfig:
type: OS::TripleO::Tasks::{{role.name}}PreConfig
properties:
servers: {get_param: [servers, {{role.name}}]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{{role.name}}Config:
type: OS::TripleO::{{role.name}}Config
properties:
StepConfig: {get_param: [role_data, {{role.name}}, step_config]}
{% if role.name == 'Controller' %}
ControllerPrePuppet:
type: OS::TripleO::Tasks::ControllerPrePuppet
properties:
servers: {get_param: [servers, Controller]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{% endif %}
# Step through a series of configuration steps
{% for step in range(1, 6) %}
{{role.name}}Deployment_Step{{step}}:
type: OS::Heat::StructuredDeploymentGroup
{% if step == 1 %}
depends_on: [{{role.name}}PreConfig, {{role.name}}ArtifactsDeploy]
{% else %}
depends_on:
{% for dep in roles %}
- {{dep.name}}Deployment_Step{{step -1}}
{% endfor %}
{% endif %}
properties:
name: {{role.name}}Deployment_Step{{step}}
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}Config}
input_values:
step: {{step}}
update_identifier: {get_param: DeployIdentifier}
{% endfor %}
{{role.name}}PostConfig:
type: OS::TripleO::Tasks::{{role.name}}PostConfig
depends_on:
{% for dep in roles %}
- {{dep.name}}Deployment_Step5
{% endfor %}
properties:
servers: {get_param: servers}
input_values:
update_identifier: {get_param: DeployIdentifier}
# Note, this should come last, so use depends_on to ensure
# this is created after any other resources.
{{role.name}}ExtraConfigPost:
depends_on:
{% for dep in roles %}
- {{dep.name}}PostConfig
{% endfor %}
type: OS::TripleO::NodeExtraConfigPost
properties:
servers: {get_param: [servers, {{role.name}}]}
{% if role.name == 'Controller' %}
ControllerPostPuppet:
depends_on:
- ControllerExtraConfigPost
type: OS::TripleO::Tasks::ControllerPostPuppet
properties:
servers: {get_param: [servers, Controller]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{% endif %}
{% endfor %}
{% include 'puppet-steps.j2' %}

@ -0,0 +1,88 @@
# Post deployment steps for all roles
# A single config is re-applied with an incrementing step number
{% for role in roles %}
# {{role.name}} Role post-deploy steps
{{role.name}}ArtifactsConfig:
type: deploy-artifacts.yaml
{{role.name}}ArtifactsDeploy:
type: OS::Heat::StructuredDeployments
properties:
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}ArtifactsConfig}
{{role.name}}PreConfig:
type: OS::TripleO::Tasks::{{role.name}}PreConfig
properties:
servers: {get_param: [servers, {{role.name}}]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{{role.name}}Config:
type: OS::TripleO::{{role.name}}Config
properties:
StepConfig: {get_param: [role_data, {{role.name}}, step_config]}
{% if role.name == 'Controller' %}
ControllerPrePuppet:
type: OS::TripleO::Tasks::ControllerPrePuppet
properties:
servers: {get_param: [servers, Controller]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{% endif %}
# Step through a series of configuration steps
{% for step in range(1, 6) %}
{{role.name}}Deployment_Step{{step}}:
type: OS::Heat::StructuredDeploymentGroup
{% if step == 1 %}
depends_on: [{{role.name}}PreConfig, {{role.name}}ArtifactsDeploy]
{% else %}
depends_on:
{% for dep in roles %}
- {{dep.name}}Deployment_Step{{step -1}}
{% endfor %}
{% endif %}
properties:
name: {{role.name}}Deployment_Step{{step}}
servers: {get_param: [servers, {{role.name}}]}
config: {get_resource: {{role.name}}Config}
input_values:
step: {{step}}
update_identifier: {get_param: DeployIdentifier}
{% endfor %}
{{role.name}}PostConfig:
type: OS::TripleO::Tasks::{{role.name}}PostConfig
depends_on:
{% for dep in roles %}
- {{dep.name}}Deployment_Step5
{% endfor %}
properties:
servers: {get_param: servers}
input_values:
update_identifier: {get_param: DeployIdentifier}
# Note, this should come last, so use depends_on to ensure
# this is created after any other resources.
{{role.name}}ExtraConfigPost:
depends_on:
{% for dep in roles %}
- {{dep.name}}PostConfig
{% endfor %}
type: OS::TripleO::NodeExtraConfigPost
properties:
servers: {get_param: [servers, {{role.name}}]}
{% if role.name == 'Controller' %}
ControllerPostPuppet:
depends_on:
- ControllerExtraConfigPost
type: OS::TripleO::Tasks::ControllerPostPuppet
properties:
servers: {get_param: [servers, Controller]}
input_values:
update_identifier: {get_param: DeployIdentifier}
{% endif %}
{% endfor %}
Loading…
Cancel
Save