Add "tripleo-common-managed" to all workflows in tripleo_common

At the moment instack-undercloud deletes all workflows with "tripleo" in
the name. This has caused an issue when workflows come from other
locations but shouldn't be deleted.

Adding the tag allows instack-undercloud to delete only workflows with
this tag. It shouldn't delete or touch workflows outside of the
tripleo-common package.

Parital-Bug: #1715389
Change-Id: Ieeb51f8e705b8988fb4d0f5d17d7fce6b5b04f36
This commit is contained in:
Dougal Matthews 2017-09-06 16:46:11 +01:00
parent 48413715f8
commit e0434359dd
15 changed files with 233 additions and 0 deletions

View File

@ -0,0 +1,41 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import yaml
from tripleo_common.tests import base
WORKBOOK_DIRECTORY = os.path.join(os.path.dirname(__file__),
'..', '..', 'workbooks')
class TestWorkflowStructure(base.TestCase):
def setUp(self):
self.workbooks = os.listdir(WORKBOOK_DIRECTORY)
super(TestWorkflowStructure, self).setUp()
def test_tags_are_set(self):
for workbook in self.workbooks:
full_path = os.path.join(WORKBOOK_DIRECTORY, workbook)
with open(full_path) as f:
wb_yaml = yaml.load(f)
message = ("tripleo-common-managed tag is missing from a "
"workflow in {}").format(full_path)
for wf_name, wf_spec in wb_yaml['workflows'].items():
self.assertIn('tags', wf_spec, message)
self.assertIn('tripleo-common-managed', wf_spec['tags'],
message)

View File

@ -18,6 +18,8 @@ workflows:
of servers) need to be provided -- these are only used of servers) need to be provided -- these are only used
temporarily to create the actual ssh admin user for use by temporarily to create the actual ssh admin user for use by
Mistral. Mistral.
tags:
- tripleo-common-managed
input: input:
- ssh_private_key: null - ssh_private_key: null
- ssh_user: null - ssh_user: null
@ -86,6 +88,8 @@ workflows:
input: input:
- tasks - tasks
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
get_servers: get_servers:
action: nova.servers_list action: nova.servers_list
@ -113,6 +117,8 @@ workflows:
- ssh_private_key - ssh_private_key
- ssh_user - ssh_user
- ssh_servers - ssh_servers
tags:
- tripleo-common-managed
tasks: tasks:
write_tmp_playbook: write_tmp_playbook:
action: tripleo.ansible-playbook action: tripleo.ansible-playbook

View File

@ -11,6 +11,9 @@ workflows:
- state_action - state_action
- target_state - target_state
tags:
- tripleo-common-managed
tasks: tasks:
set_provision_state: set_provision_state:
@ -31,6 +34,9 @@ workflows:
- state_action - state_action
- target_state - target_state
tags:
- tripleo-common-managed
tasks: tasks:
set_provision_state: set_provision_state:
@ -54,6 +60,9 @@ workflows:
- retry_count: 720 - retry_count: 720
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
set_provision_state: set_provision_state:
@ -98,6 +107,9 @@ workflows:
- nodes_json - nodes_json
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
validate_nodes: validate_nodes:
@ -140,6 +152,9 @@ workflows:
- instance_boot_option: local - instance_boot_option: local
- initial_state: manageable - initial_state: manageable
tags:
- tripleo-common-managed
tasks: tasks:
validate_input: validate_input:
@ -236,6 +251,9 @@ workflows:
- node_uuids - node_uuids
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
set_nodes_available: set_nodes_available:
@ -314,6 +332,9 @@ workflows:
input: input:
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
get_manageable_nodes: get_manageable_nodes:
@ -360,6 +381,9 @@ workflows:
- node_uuids - node_uuids
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
set_nodes_manageable: set_nodes_manageable:
@ -406,6 +430,9 @@ workflows:
output: output:
result: <% task(start_introspection).result %> result: <% task(start_introspection).result %>
tags:
- tripleo-common-managed
tasks: tasks:
start_introspection: start_introspection:
action: baremetal_introspection.introspect uuid=<% $.node_uuid %> action: baremetal_introspection.introspect uuid=<% $.node_uuid %>
@ -482,6 +509,9 @@ workflows:
- max_retry_attempts: 2 - max_retry_attempts: 2
- node_timeout: 1200 - node_timeout: 1200
tags:
- tripleo-common-managed
tasks: tasks:
initialize: initialize:
publish: publish:
@ -590,6 +620,9 @@ workflows:
- run_validations: False - run_validations: False
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
get_manageable_nodes: get_manageable_nodes:
@ -653,6 +686,9 @@ workflows:
- root_device_minimum_size: 4 - root_device_minimum_size: 4
- overwrite_root_device_hints: False - overwrite_root_device_hints: False
tags:
- tripleo-common-managed
tasks: tasks:
configure_boot: configure_boot:
@ -709,6 +745,9 @@ workflows:
- root_device_minimum_size: 4 - root_device_minimum_size: 4
- overwrite_root_device_hints: False - overwrite_root_device_hints: False
tags:
- tripleo-common-managed
tasks: tasks:
get_manageable_nodes: get_manageable_nodes:
@ -771,6 +810,9 @@ workflows:
task-defaults: task-defaults:
on-error: send_message on-error: send_message
tags:
- tripleo-common-managed
tasks: tasks:
update_node: update_node:
@ -807,6 +849,9 @@ workflows:
task-defaults: task-defaults:
on-error: send_message on-error: send_message
tags:
- tripleo-common-managed
tasks: tasks:
tag_nodes: tag_nodes:
@ -856,6 +901,9 @@ workflows:
- profile - profile
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
get_available_nodes: get_available_nodes:
action: ironic.node_list maintenance=false provision_state='available' detail=true action: ironic.node_list maintenance=false provision_state='available' detail=true
@ -905,6 +953,9 @@ workflows:
- configuration - configuration
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
set_configuration: set_configuration:
@ -967,6 +1018,9 @@ workflows:
- node_uuids - node_uuids
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
cell_v2_discover_hosts: cell_v2_discover_hosts:
@ -1017,6 +1071,9 @@ workflows:
- ports: [623] - ports: [623]
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
get_all_nodes: get_all_nodes:
@ -1102,6 +1159,9 @@ workflows:
- initial_state: manageable - initial_state: manageable
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
discover_nodes: discover_nodes:

View File

@ -11,6 +11,8 @@ workflows:
- ansible_skip_tags: 'package-install,with_pkg' - ansible_skip_tags: 'package-install,with_pkg'
- ceph_ansible_extra_vars: {} - ceph_ansible_extra_vars: {}
- ceph_ansible_playbook: /usr/share/ceph-ansible/site-docker.yml.sample - ceph_ansible_playbook: /usr/share/ceph-ansible/site-docker.yml.sample
tags:
- tripleo-common-managed
tasks: tasks:
enable_ssh_admin: enable_ssh_admin:
workflow: tripleo.access.v1.enable_ssh_admin workflow: tripleo.access.v1.enable_ssh_admin

View File

@ -15,6 +15,9 @@ workflows:
- group - group
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
deploy_config: deploy_config:
@ -54,6 +57,9 @@ workflows:
- group: script - group: script
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
get_servers_matching: get_servers_matching:
@ -113,6 +119,9 @@ workflows:
- skip_deploy_identifier: False - skip_deploy_identifier: False
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
add_validation_ssh_key: add_validation_ssh_key:

View File

@ -13,6 +13,9 @@ workflows:
- queue_name: tripleo - queue_name: tripleo
- user_inputs: {} - user_inputs: {}
tags:
- tripleo-common-managed
tasks: tasks:
get_flattened_parameters: get_flattened_parameters:
action: tripleo.parameters.get_flatten container=<% $.plan %> action: tripleo.parameters.get_flatten container=<% $.plan %>
@ -151,6 +154,9 @@ workflows:
# Need role_name in output parameter to display the status for all roles in main workflow when any role fails here. # Need role_name in output parameter to display the status for all roles in main workflow when any role fails here.
role_name: <% $.role_name %> role_name: <% $.role_name %>
tags:
- tripleo-common-managed
tasks: tasks:
get_role_info: get_role_info:
workflow: _get_role_info workflow: _get_role_info
@ -319,6 +325,9 @@ workflows:
- role_name - role_name
- heat_resource_tree - heat_resource_tree
tags:
- tripleo-common-managed
tasks: tasks:
get_resource_chains: get_resource_chains:
publish: publish:

View File

@ -19,6 +19,9 @@ workflows:
output: output:
derived_parameters: <% $.derived_parameters.mergeWith($.get('dpdk_parameters', {})) %> derived_parameters: <% $.derived_parameters.mergeWith($.get('dpdk_parameters', {})) %>
tags:
- tripleo-common-managed
tasks: tasks:
get_network_config: get_network_config:
action: tripleo.parameters.get_network_config action: tripleo.parameters.get_network_config
@ -227,6 +230,9 @@ workflows:
output: output:
derived_parameters: <% $.derived_parameters.mergeWith($.get('host_parameters', {})) %> derived_parameters: <% $.derived_parameters.mergeWith($.get('host_parameters', {})) %>
tags:
- tripleo-common-managed
tasks: tasks:
get_cpus: get_cpus:
@ -355,6 +361,9 @@ workflows:
output: output:
derived_parameters: <% $.derived_parameters.mergeWith($.get('hci_parameters', {})) %> derived_parameters: <% $.derived_parameters.mergeWith($.get('hci_parameters', {})) %>
tags:
- tripleo-common-managed
tasks: tasks:
get_hci_inputs: get_hci_inputs:
publish: publish:

View File

@ -11,6 +11,9 @@ workflows:
- container - container
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
rotate_keys: rotate_keys:

View File

@ -14,6 +14,9 @@ workflows:
- timeout: 240 - timeout: 240
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
update: update:
action: tripleo.package_update.update_stack container=<% $.container %> timeout=<% $.timeout %> action: tripleo.package_update.update_stack container=<% $.container %> timeout=<% $.timeout %>
@ -49,6 +52,9 @@ workflows:
- refs - refs
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
clear: clear:
action: tripleo.package_update.clear_breakpoints stack_id=<% $.stack_id %> refs=<% $.refs %> action: tripleo.package_update.clear_breakpoints stack_id=<% $.stack_id %> refs=<% $.refs %>

View File

@ -13,6 +13,8 @@ workflows:
- container - container
- queue_name: tripleo - queue_name: tripleo
- generate_passwords: true - generate_passwords: true
tags:
- tripleo-common-managed
tasks: tasks:
call_create_deployment_plan: call_create_deployment_plan:
workflow: tripleo.plan_management.v1.create_deployment_plan workflow: tripleo.plan_management.v1.create_deployment_plan
@ -63,6 +65,9 @@ workflows:
- generate_passwords: true - generate_passwords: true
- use_default_templates: false - use_default_templates: false
tags:
- tripleo-common-managed
tasks: tasks:
container_required_check: container_required_check:
description: > description: >
@ -200,6 +205,8 @@ workflows:
- source_url: null - source_url: null
- queue_name: tripleo - queue_name: tripleo
- generate_passwords: true - generate_passwords: true
tags:
- tripleo-common-managed
tasks: tasks:
templates_source_check: templates_source_check:
on-success: on-success:
@ -313,6 +320,9 @@ workflows:
- container - container
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
verify_container_exists: verify_container_exists:
@ -363,6 +373,9 @@ workflows:
- plan - plan
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
export_plan: export_plan:
@ -423,6 +436,9 @@ workflows:
- container: overcloud - container: overcloud
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
get_flatten_data: get_flatten_data:
action: tripleo.parameters.get_flatten container=<% $.container %> action: tripleo.parameters.get_flatten container=<% $.container %>
@ -483,6 +499,9 @@ workflows:
- logging_queue_name: tripleo-ui-logging - logging_queue_name: tripleo-ui-logging
- logging_container: tripleo-ui-logs - logging_container: tripleo-ui-logs
tags:
- tripleo-common-managed
tasks: tasks:
get_messages: get_messages:
@ -552,6 +571,9 @@ workflows:
- downloads_container: "tripleo-ui-logs-downloads" - downloads_container: "tripleo-ui-logs-downloads"
- delete_after: 3600 - delete_after: 3600
tags:
- tripleo-common-managed
tasks: tasks:
prepare_log_download: prepare_log_download:

View File

@ -14,6 +14,9 @@ workflows:
- timeout: 240 - timeout: 240
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
delete_node: delete_node:

View File

@ -10,6 +10,9 @@ workflows:
- stack - stack
- timeout: 14400 # 4 hours. Default timeout of stack deployment - timeout: 14400 # 4 hours. Default timeout of stack deployment
tags:
- tripleo-common-managed
tasks: tasks:
wait_for_stack_status: wait_for_stack_status:
@ -25,6 +28,9 @@ workflows:
- stack - stack
- timeout: 600 # 10 minutes. Should not take much longer for a stack to transition to IN_PROGRESS - timeout: 600 # 10 minutes. Should not take much longer for a stack to transition to IN_PROGRESS
tags:
- tripleo-common-managed
tasks: tasks:
wait_for_stack_status: wait_for_stack_status:
@ -40,6 +46,9 @@ workflows:
- stack - stack
- timeout: 3600 - timeout: 3600
tags:
- tripleo-common-managed
tasks: tasks:
wait_for_stack_does_not_exist: wait_for_stack_does_not_exist:
action: heat.stacks_list action: heat.stacks_list
@ -54,6 +63,9 @@ workflows:
- stack - stack
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
delete_the_stack: delete_the_stack:
action: heat.stacks_delete stack_id=<% $.stack %> action: heat.stacks_delete stack_id=<% $.stack %>

View File

@ -15,6 +15,9 @@ workflows:
- sos_options: boot,cluster,hardware,kernel,memory,nfs,openstack,packagemanager,performance,services,storage,system,webserver,virt - sos_options: boot,cluster,hardware,kernel,memory,nfs,openstack,packagemanager,performance,services,storage,system,webserver,virt
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
collect_logs_on_servers: collect_logs_on_servers:
workflow: tripleo.deployment.v1.deploy_on_servers workflow: tripleo.deployment.v1.deploy_on_servers
@ -65,6 +68,9 @@ workflows:
- sos_dir: /var/tmp/tripleo-sos - sos_dir: /var/tmp/tripleo-sos
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
# actions # actions
get_swift_information: get_swift_information:
@ -138,6 +144,9 @@ workflows:
- container - container
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
check_container: check_container:
action: swift.head_container container=<% $.container %> action: swift.head_container container=<% $.container %>
@ -187,6 +196,9 @@ workflows:
- timeout: 900 - timeout: 900
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
# actions # actions
check_container: check_container:
@ -275,6 +287,9 @@ workflows:
- timeout: 1800 - timeout: 1800
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
# actions # actions
create_container: create_container:

View File

@ -11,6 +11,8 @@ workflows:
input: input:
- container - container
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
check_container: check_container:
action: swift.head_container container=<% $.container %> action: swift.head_container container=<% $.container %>

View File

@ -11,6 +11,9 @@ workflows:
- plan: overcloud - plan: overcloud
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
notify_running: notify_running:
@ -68,6 +71,9 @@ workflows:
- plan: overcloud - plan: overcloud
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
notify_running: notify_running:
@ -120,6 +126,9 @@ workflows:
- plan: overcloud - plan: overcloud
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
find_validations: find_validations:
@ -177,11 +186,15 @@ workflows:
list: list:
input: input:
- group_names: [] - group_names: []
tags:
- tripleo-common-managed
tasks: tasks:
find_validations: find_validations:
action: tripleo.validations.list_validations groups=<% $.group_names %> action: tripleo.validations.list_validations groups=<% $.group_names %>
list_groups: list_groups:
tags:
- tripleo-common-managed
tasks: tasks:
find_groups: find_groups:
action: tripleo.validations.list_groups action: tripleo.validations.list_groups
@ -191,6 +204,9 @@ workflows:
- container - container
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
test_validations_enabled: test_validations_enabled:
action: tripleo.validations.enabled action: tripleo.validations.enabled
@ -225,6 +241,8 @@ workflows:
# have it present # have it present
- overcloud_admin: heat-admin - overcloud_admin: heat-admin
- queue_name: tripleo - queue_name: tripleo
tags:
- tripleo-common-managed
tasks: tasks:
get_servers: get_servers:
action: nova.servers_list action: nova.servers_list
@ -264,6 +282,8 @@ workflows:
warnings: <% $.warnings %> warnings: <% $.warnings %>
kernel_id: <% $.kernel_id %> kernel_id: <% $.kernel_id %>
ramdisk_id: <% $.ramdisk_id %> ramdisk_id: <% $.ramdisk_id %>
tags:
- tripleo-common-managed
tasks: tasks:
check_run_validations: check_run_validations:
on-complete: on-complete:
@ -330,6 +350,9 @@ workflows:
warnings: <% $.warnings %> warnings: <% $.warnings %>
flavors: <% $.flavors %> flavors: <% $.flavors %>
tags:
- tripleo-common-managed
tasks: tasks:
check_run_validations: check_run_validations:
on-complete: on-complete:
@ -385,6 +408,9 @@ workflows:
errors: <% $.errors %> errors: <% $.errors %>
warnings: <% $.warnings %> warnings: <% $.warnings %>
tags:
- tripleo-common-managed
tasks: tasks:
check_run_validations: check_run_validations:
on-complete: on-complete:
@ -456,6 +482,9 @@ workflows:
errors: <% $.errors %> errors: <% $.errors %>
warnings: <% $.warnings %> warnings: <% $.warnings %>
tags:
- tripleo-common-managed
tasks: tasks:
check_run_validations: check_run_validations:
on-complete: on-complete:
@ -527,6 +556,9 @@ workflows:
errors: <% $.errors %> errors: <% $.errors %>
warnings: <% $.warnings %> warnings: <% $.warnings %>
tags:
- tripleo-common-managed
tasks: tasks:
check_run_validations: check_run_validations:
on-complete: on-complete:
@ -656,6 +688,8 @@ workflows:
ramdisk_id: <% $.ramdisk_id %> ramdisk_id: <% $.ramdisk_id %>
flavors: <% $.flavors %> flavors: <% $.flavors %>
statistics: <% $.statistics %> statistics: <% $.statistics %>
tags:
- tripleo-common-managed
tasks: tasks:
init_messages: init_messages:
on-success: check_boot_images on-success: check_boot_images