Browse Source

Consolidate puppet/docker deployments with one deploy steps workflow

If we consolidate these we can focus on one implementation (the new ansible
based one used for docker-steps)

Change-Id: Iec0ad2278d62040bf03613fc9556b199c6a80546
Depends-On: Ifa2afa915e0fee368fb2506c02de75bf5efe82d5
changes/93/483293/20
Steven Hardy 4 years ago
committed by Athlan-Guyot sofer
parent
commit
7f6305980d
  1. 0
      common/deploy-steps-playbook.yaml
  2. 2
      common/deploy-steps.j2
  3. 0
      common/major_upgrade_steps.j2.yaml
  4. 2
      common/post-upgrade.j2.yaml
  5. 1
      common/post.j2.yaml
  6. 1
      docker/post.j2.yaml
  7. 3
      environments/docker-services-tls-everywhere.yaml
  8. 3
      environments/docker.yaml
  9. 5
      environments/major-upgrade-composable-steps-docker.yaml
  10. 2
      environments/major-upgrade-converge-docker.yaml
  11. 2
      environments/major-upgrade-converge.yaml
  12. 6
      overcloud-resource-registry-puppet.j2.yaml
  13. 30
      puppet/post-upgrade.j2.yaml
  14. 31
      puppet/post.j2.yaml
  15. 156
      puppet/puppet-steps.j2

0
docker/deploy-steps-playbook.yaml → common/deploy-steps-playbook.yaml

2
docker/docker-steps.j2 → common/deploy-steps.j2

@ -159,7 +159,7 @@ resources:
connection: local
vars:
puppet_config: {get_param: [role_data, {{role.name}}, puppet_config]}
docker_puppet_script: {get_file: docker-puppet.py}
docker_puppet_script: {get_file: ../docker/docker-puppet.py}
docker_puppet_tasks: {get_param: [role_data, {{role.name}}, docker_puppet_tasks]}
docker_startup_configs: {get_param: [role_data, {{role.name}}, docker_config]}
kolla_config: {get_param: [role_data, {{role.name}}, kolla_config]}

0
puppet/major_upgrade_steps.j2.yaml → common/major_upgrade_steps.j2.yaml

2
docker/post-upgrade.j2.yaml → common/post-upgrade.j2.yaml

@ -1,4 +1,4 @@
# 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 'docker-steps.j2' %}
{% include 'deploy-steps.j2' %}

1
common/post.j2.yaml

@ -0,0 +1 @@
{% include 'deploy-steps.j2' %}

1
docker/post.j2.yaml

@ -1 +0,0 @@
{% include 'docker-steps.j2' %}

3
environments/docker-services-tls-everywhere.yaml

@ -41,6 +41,3 @@ resource_registry:
OS::TripleO::Services::SwiftProxy: ../docker/services/swift-proxy.yaml
OS::TripleO::Services::SwiftRingBuilder: ../docker/services/swift-ringbuilder.yaml
OS::TripleO::Services::SwiftStorage: ../docker/services/swift-storage.yaml
OS::TripleO::PostDeploySteps: ../docker/post.yaml
OS::TripleO::PostUpgradeSteps: ../docker/post-upgrade.yaml

3
environments/docker.yaml

@ -61,6 +61,3 @@ resource_registry:
# OS::TripleO::Services::CinderScheduler: ../docker/services/cinder-scheduler.yaml
# OS::TripleO::Services::CinderBackup: ../docker/services/cinder-backup.yaml
# OS::TripleO::Services::CinderVolume: ../docker/services/cinder-volume.yaml
OS::TripleO::PostDeploySteps: ../docker/post.yaml
OS::TripleO::PostUpgradeSteps: ../docker/post-upgrade.yaml

5
environments/major-upgrade-composable-steps-docker.yaml

@ -1,8 +1,5 @@
resource_registry:
# FIXME(shardy) do we need to break major_upgrade_steps.yaml apart to
# enable docker specific logic, or is just overridding PostUpgradeSteps
# enough (as we want to share the ansible tasks steps etc)
OS::TripleO::PostDeploySteps: ../puppet/major_upgrade_steps.yaml
OS::TripleO::PostDeploySteps: ../common/major_upgrade_steps.yaml
parameter_defaults:
EnableConfigPurge: false
StackUpdateType: UPGRADE

2
environments/major-upgrade-converge-docker.yaml

@ -1,7 +1,7 @@
# Use this to reset any mappings only used for upgrades after the
# update of all nodes is completed
resource_registry:
OS::TripleO::PostDeploySteps: ../docker/post.yaml
OS::TripleO::PostDeploySteps: ../common/post.yaml
parameter_defaults:
EnableConfigPurge: false
StackUpdateType: ''

2
environments/major-upgrade-converge.yaml

@ -1,7 +1,7 @@
# Use this to reset any mappings only used for upgrades after the
# update of all nodes is completed
resource_registry:
OS::TripleO::PostDeploySteps: ../puppet/post.yaml
OS::TripleO::PostDeploySteps: ../common/post.yaml
parameter_defaults:
EnableConfigPurge: false
StackUpdateType: ''

6
overcloud-resource-registry-puppet.j2.yaml

@ -1,8 +1,8 @@
resource_registry:
OS::TripleO::SoftwareDeployment: OS::Heat::StructuredDeployment
OS::TripleO::PostDeploySteps: puppet/post.yaml
OS::TripleO::PostUpgradeSteps: puppet/post-upgrade.yaml
OS::TripleO::PostDeploySteps: common/post.yaml
OS::TripleO::PostUpgradeSteps: common/post-upgrade.yaml
OS::TripleO::AllNodes::SoftwareConfig: puppet/all-nodes-config.yaml
OS::TripleO::AllNodesDeployment: OS::Heat::StructuredDeployments
OS::TripleO::Hosts::SoftwareConfig: hosts-config.yaml
@ -17,7 +17,7 @@ resource_registry:
{% for role in roles %}
OS::TripleO::{{role.name}}::PreNetworkConfig: OS::Heat::None
OS::TripleO::{{role.name}}PostDeploySteps: puppet/post.yaml
OS::TripleO::{{role.name}}PostDeploySteps: common/post.yaml
OS::TripleO::{{role.name}}: puppet/{{role.name.lower()}}-role.yaml
OS::TripleO::{{role.name}}Config: puppet/{{role.name.lower()}}-config.yaml
OS::TripleO::Tasks::{{role.name}}PreConfig: OS::Heat::None

30
puppet/post-upgrade.j2.yaml

@ -1,30 +0,0 @@
heat_template_version: pike
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
stack_name:
type: string
description: Name of the topmost stack
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.
ctlplane_service_ips:
type: json
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' %}

31
puppet/post.j2.yaml

@ -1,31 +0,0 @@
heat_template_version: pike
description: >
Post-deploy configuration steps via puppet for all roles,
as defined in ../roles_data.yaml
parameters:
servers:
type: json
description: Mapping of Role name e.g Controller to a list of servers
stack_name:
type: string
description: Name of the topmost stack
role_data:
type: json
description: Mapping of Role name e.g Controller to the per-role data
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
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.
ctlplane_service_ips:
type: json
{% include 'puppet-steps.j2' %}

156
puppet/puppet-steps.j2

@ -1,156 +0,0 @@
{% set deploy_steps_max = 6 %}
conditions:
{% for step in range(1, deploy_steps_max) %}
WorkflowTasks_Step{{step}}_Enabled:
or:
{%- for role in roles %}
- not:
equals:
- get_param: [role_data, {{role.name}}, service_workflow_tasks, step{{step}}]
- ''
- False
{%- endfor %}
{% endfor %}
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:
name: {{role.name}}ArtifactsDeploy
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]}
# Step through a series of configuration steps
{% for step in range(1, deploy_steps_max) %}
{{role.name}}Deployment_Step{{step}}:
type: OS::Heat::StructuredDeploymentGroup
depends_on:
- WorkflowTasks_Step{{step}}_Execution
# TODO(gfidente): the following if/else condition
# replicates what is already defined for the
# WorkflowTasks_StepX resource and can be remove
# if https://bugs.launchpad.net/heat/+bug/1700569
# is fixed.
{%- if step == 1 %}
{%- for dep in roles %}
- {{dep.name}}PreConfig
- {{dep.name}}ArtifactsDeploy
{%- endfor %}
{%- else %}
{%- 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 %}
# Note, this should be the last step to execute configuration changes.
# Ensure that all {{role.name}}ExtraConfigPost steps are executed
# after all the previous deployment steps.
{{role.name}}ExtraConfigPost:
depends_on:
{%- for dep in roles %}
- {{dep.name}}Deployment_Step5
{%- endfor %}
type: OS::TripleO::NodeExtraConfigPost
properties:
servers: {get_param: [servers, {{role.name}}]}
# The {{role.name}}PostConfig steps are in charge of
# quiescing all services, i.e. in the Controller case,
# we should run a full service reload.
{{role.name}}PostConfig:
type: OS::TripleO::Tasks::{{role.name}}PostConfig
depends_on:
{%- for dep in roles %}
- {{dep.name}}ExtraConfigPost
{%- endfor %}
properties:
servers: {get_param: servers}
input_values:
update_identifier: {get_param: DeployIdentifier}
{% endfor %}
# BEGIN service_workflow_tasks handling
{% for step in range(1, deploy_steps_max) %}
WorkflowTasks_Step{{step}}:
type: OS::Mistral::Workflow
condition: WorkflowTasks_Step{{step}}_Enabled
depends_on:
{%- if step == 1 %}
{%- for dep in roles %}
- {{dep.name}}PreConfig
- {{dep.name}}ArtifactsDeploy
{%- endfor %}
{%- else %}
{%- for dep in roles %}
- {{dep.name}}Deployment_Step{{step -1}}
{%- endfor %}
{%- endif %}
properties:
name: {list_join: [".", ["tripleo", {get_param: stack_name}, "workflowtasks", "step{{step}}"]]}
type: direct
tasks:
yaql:
expression: $.data.where($ != '').select($.get('step{{step}}')).where($ != null).flatten()
data:
{%- for role in roles %}
- get_param: [role_data, {{role.name}}, service_workflow_tasks]
{%- endfor %}
WorkflowTasks_Step{{step}}_Execution:
type: OS::Mistral::ExternalResource
condition: WorkflowTasks_Step{{step}}_Enabled
depends_on: WorkflowTasks_Step{{step}}
properties:
actions:
CREATE:
workflow: { get_resource: WorkflowTasks_Step{{step}} }
params:
env:
service_ips: { get_param: ctlplane_service_ips }
role_merged_configs:
{%- for r in roles %}
{{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]}
{%- endfor %}
evaluate_env: false
UPDATE:
workflow: { get_resource: WorkflowTasks_Step{{step}} }
params:
env:
service_ips: { get_param: ctlplane_service_ips }
role_merged_configs:
{%- for r in roles %}
{{r.name}}: {get_param: [role_data, {{r.name}}, merged_config_settings]}
{%- endfor %}
evaluate_env: false
always_update: true
{% endfor %}
# END service_workflow_tasks handling
Loading…
Cancel
Save