Add deploy_steps_tasks interface
This allows per-step ansible tasks to be run on the nodes when using
the config download mechanism, e.g adding the following to a service
template will create /tmp/testperstep populated for every step.
deploy_steps_tasks:
- name: Test something happens each step
lineinfile:
path: /tmp/testperstep
create: true
line: "{{step}} step happened"
Change-Id: Ic34f5c48736b6340a1cfcea614b05e33e2fce040
This commit is contained in:
committed by
Juan Antonio Osorio Robles
parent
f253c0d08d
commit
0524c86353
@@ -378,7 +378,7 @@ outputs:
|
|||||||
RoleConfig:
|
RoleConfig:
|
||||||
description: Mapping of config data for all roles
|
description: Mapping of config data for all roles
|
||||||
value:
|
value:
|
||||||
deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
|
common_deploy_steps_tasks: {get_file: deploy-steps-tasks.yaml}
|
||||||
deploy_steps_playbook:
|
deploy_steps_playbook:
|
||||||
str_replace:
|
str_replace:
|
||||||
params:
|
params:
|
||||||
@@ -438,14 +438,32 @@ outputs:
|
|||||||
- external
|
- external
|
||||||
- external_deploy_steps
|
- external_deploy_steps
|
||||||
- hosts: overcloud
|
- hosts: overcloud
|
||||||
name: Overcloud deployment step {{step}}
|
name: Overcloud deploy step tasks for {{step}}
|
||||||
|
gather_facts: no
|
||||||
|
any_errors_fatal: yes
|
||||||
|
# FIXME(shardy) - it would be nice to use strategy: free to
|
||||||
|
# allow the tasks per-step to run in parallel on each role,
|
||||||
|
# but that doesn't work with any_errors_fatal: yes
|
||||||
|
vars:
|
||||||
|
bootstrap_server_id: BOOTSTRAP_SERVER_ID
|
||||||
|
step: '{{step}}'
|
||||||
|
tasks:
|
||||||
|
{%- for role in roles %}
|
||||||
|
- include: {{role.name}}/deploy_steps_tasks.yaml
|
||||||
|
when: role_name == '{{role.name}}'
|
||||||
|
{%- endfor %}
|
||||||
|
tags:
|
||||||
|
- overcloud
|
||||||
|
- deploy_steps
|
||||||
|
- hosts: overcloud
|
||||||
|
name: Overcloud common deploy step tasks {{step}}
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
any_errors_fatal: yes
|
any_errors_fatal: yes
|
||||||
vars:
|
vars:
|
||||||
bootstrap_server_id: BOOTSTRAP_SERVER_ID
|
bootstrap_server_id: BOOTSTRAP_SERVER_ID
|
||||||
step: '{{step}}'
|
step: '{{step}}'
|
||||||
tasks:
|
tasks:
|
||||||
- include: deploy_steps_tasks.yaml
|
- include: common_deploy_steps_tasks.yaml
|
||||||
tags:
|
tags:
|
||||||
- overcloud
|
- overcloud
|
||||||
- deploy_steps
|
- deploy_steps
|
||||||
|
|||||||
@@ -208,6 +208,16 @@ resources:
|
|||||||
expression: coalesce($.data.role_data, []).where($ != null).select($.get('workflow_tasks')).where($ != null).reduce($1.mergeWith($2), {})
|
expression: coalesce($.data.role_data, []).where($ != null).select($.get('workflow_tasks')).where($ != null).reduce($1.mergeWith($2), {})
|
||||||
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
data: {role_data: {get_attr: [ServiceChain, role_data]}}
|
||||||
|
|
||||||
|
DeployStepsTasks:
|
||||||
|
type: OS::Heat::Value
|
||||||
|
properties:
|
||||||
|
type: comma_delimited_list
|
||||||
|
value:
|
||||||
|
yaql:
|
||||||
|
# Note we use distinct() here to filter any identical tasks, e.g yum update for all services
|
||||||
|
expression: coalesce($.data, []).where($ != null).select($.get('deploy_steps_tasks')).where($ != null).flatten().distinct()
|
||||||
|
data: {get_attr: [ServiceChain, role_data]}
|
||||||
|
|
||||||
ExternalDeployTasks:
|
ExternalDeployTasks:
|
||||||
type: OS::Heat::Value
|
type: OS::Heat::Value
|
||||||
properties:
|
properties:
|
||||||
@@ -317,6 +327,7 @@ outputs:
|
|||||||
service_config_settings: {get_attr: [ServiceConfigSettings, value]}
|
service_config_settings: {get_attr: [ServiceConfigSettings, value]}
|
||||||
workflow_tasks: {get_attr: [WorkflowTasks, value]}
|
workflow_tasks: {get_attr: [WorkflowTasks, value]}
|
||||||
step_config: {get_attr: [PuppetStepConfig, value]}
|
step_config: {get_attr: [PuppetStepConfig, value]}
|
||||||
|
deploy_steps_tasks: {get_attr: [DeployStepsTasks, value]}
|
||||||
external_deploy_tasks: {get_attr: [ExternalDeployTasks, value]}
|
external_deploy_tasks: {get_attr: [ExternalDeployTasks, value]}
|
||||||
external_post_deploy_tasks: {get_attr: [ExternalPostDeployTasks, value]}
|
external_post_deploy_tasks: {get_attr: [ExternalPostDeployTasks, value]}
|
||||||
upgrade_tasks: {get_attr: [UpgradeTasks, value]}
|
upgrade_tasks: {get_attr: [UpgradeTasks, value]}
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Support added for per-service deploy_steps_tasks which are run every
|
||||||
|
step on the overcloud nodes.
|
||||||
Reference in New Issue
Block a user