diff --git a/workbooks/deployment.yaml b/workbooks/deployment.yaml index f46586280..a425de212 100644 --- a/workbooks/deployment.yaml +++ b/workbooks/deployment.yaml @@ -186,21 +186,6 @@ workflows: use_default_templates: true publish-on-error: message: <% task().result %> - on-success: create_ceph_ansible_fetch_directory_backup_plan - on-error: set_deployment_failed - - create_ceph_ansible_fetch_directory_backup_plan: - workflow: tripleo.swift_backup.v1.create_swift_backup_container_plan - input: - container: <% $.container %> - queue_name: <% $.queue_name %> - container_suffix: "_ceph_ansible_fetch_dir" - swift_tar: "temporary_dir.tar.gz" - get_url_parm: SwiftFetchDirGetTempurl - put_url_parm: SwiftFetchDirPutTempurl - use_default_templates: true - publish-on-error: - message: <% task().result %> on-success: cell_v2_discover_hosts on-error: set_deployment_failed diff --git a/workbooks/plan_management.yaml b/workbooks/plan_management.yaml index ce7166d02..c9734d534 100644 --- a/workbooks/plan_management.yaml +++ b/workbooks/plan_management.yaml @@ -278,7 +278,9 @@ workflows: create_swift_rings_backup_plan: workflow: tripleo.swift_backup.v1.create_swift_backup_container_plan - on-success: create_ceph_ansible_fetch_directory_backup_plan + on-success: + - set_status_success: <% $.plan_environment = null %> + - upload_plan_environment: <% $.plan_environment != null %> on-error: create_swift_rings_backup_plan_set_status_failed input: container: <% $.container %> @@ -290,32 +292,6 @@ workflows: use_default_templates: true validate_stack: <% $.validate_stack %> - create_ceph_ansible_fetch_directory_backup_plan: - workflow: tripleo.swift_backup.v1.create_swift_backup_container_plan - on-success: does_ceph_ansible_fetch_directory_backup_need_rename - on-error: create_ceph_ansible_fetch_directory_backup_plan_set_status_failed - input: - container: <% $.container %> - queue_name: <% $.queue_name %> - container_suffix: "_ceph_ansible_fetch_dir" - swift_tar: "temporary_dir.tar.gz" - get_url_parm: SwiftFetchDirGetTempurl - put_url_parm: SwiftFetchDirPutTempurl - use_default_templates: true - validate_stack: <% $.validate_stack %> - - does_ceph_ansible_fetch_directory_backup_need_rename: - workflow: tripleo.rename_ceph_ansible_fetch_directory.v1.check_and_rename - on-success: - - set_status_success: <% $.plan_environment = null %> - - upload_plan_environment: <% $.plan_environment != null %> - on-error: does_ceph_ansible_fetch_directory_backup_need_rename_set_status_failed - input: - container: <% $.container %> - queue_name: <% $.queue_name %> - container_suffix: "_ceph_ansible_fetch_dir" - swift_tar: "temporary_dir.tar.gz" - upload_plan_environment: action: tripleo.templates.upload_plan_environment container=<% $.container %> plan_environment=<% $.plan_environment %> on-success: set_status_success @@ -333,18 +309,6 @@ workflows: status: FAILED message: <% task(create_swift_rings_backup_plan).result %> - create_ceph_ansible_fetch_directory_backup_plan_set_status_failed: - on-success: send_message - publish: - status: FAILED - message: <% task(create_ceph_ansible_fetch_directory_backup_plan).result %> - - does_ceph_ansible_fetch_directory_backup_need_rename_set_status_failed: - on-success: send_message - publish: - status: FAILED - message: <% task(create_ceph_ansible_fetch_directory_backup_plan).result %> - clone_git_repo_set_status_failed: on-success: send_message publish: diff --git a/workbooks/rename_ceph_ansible_fetch_directory.yaml b/workbooks/rename_ceph_ansible_fetch_directory.yaml deleted file mode 100644 index 063a820ad..000000000 --- a/workbooks/rename_ceph_ansible_fetch_directory.yaml +++ /dev/null @@ -1,105 +0,0 @@ ---- -version: '2.0' -name: tripleo.rename_ceph_ansible_fetch_directory.v1 -description: TripleO rename ceph-ansible fetch directory backup in Swift Workflow v1 - -workflows: - check_and_rename: - description: > - If the name of the tarball containing the ceph-ansible fetch directory - matches the format found in Queens, then rename it to match the format - expected in Rocky. I.e if temporary_dir-20180915-191756.tar.gz is found - then rename it to temporary_dir.tar.gz. This workflow is idempotent and - should be run before upgrading from Queens to Rocky. - input: - - container: overcloud - - queue_name: tripleo - - container_suffix: "_ceph_ansible_fetch_dir" - - swift_tar: "temporary_dir.tar.gz" - tags: - - tripleo-common-managed - tasks: - swift_container: - publish: - swift_container: "<% $.container %><% $.container_suffix %>" - on-complete: verify_container_exists - - verify_container_exists: - action: swift.head_container container=<% $.swift_container %> - on-success: get_object_list - on-error: verify_container_exists_set_status_failed - - get_object_list: - # the get_container result[1] will be a list of objects (even if list is empty) - action: swift.get_container container=<% $.swift_container %> - publish: - object_list: <% task().result[1] %> - on-success: set_need_rename - on-error: get_object_list_set_status_failed - - set_need_rename: - # if the list is empty, do not rename; otherwise check if name matches queens pattern - publish: - need_rename: <% switch($.object_list.len() = 0 => false, $.object_list.len() = 1 => $.object_list.first().get("name").matches("temporary_dir-[0-9]{4}(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])-(2[0-3]|[01][0-9])[0-5][0-9][0-5][0-9].tar.gz")) %> - on-success: switch_on_need_rename - on-error: set_need_rename_set_status_failed - - switch_on_need_rename: - on-success: - - copy_to_new_name: <% $.need_rename = true %> - - set_status_success: <% $.need_rename != true %> - - copy_to_new_name: - action: swift.copy_object container=<% $.swift_container %> obj=<% $.object_list.first().get("name") %> destination=<% concat($.swift_container, '/', $.swift_tar) %> - on-success: remove_old_name - on-error: copy_to_new_name_set_status_failed - - remove_old_name: - action: swift.delete_object container=<% $.swift_container %> obj=<% $.object_list.first().get("name") %> - on-success: set_status_success - on-error: remove_old_name_set_status_failed - - set_status_success: - on-success: notify_zaqar - publish: - status: SUCCESS - message: <% switch($.need_rename = true => "The backup of the ceph-ansible fetch directory was renamed", $.need_rename != true => "The backup of the ceph-ansible fetch directory did not need to be renamed") %> - - verify_container_exists_set_status_failed: - on-success: notify_zaqar - publish: - status: FAILED - message: <% task(verify_container_exists).result %> - - get_object_list_set_status_failed: - on-success: notify_zaqar - publish: - status: FAILED - message: <% task(get_object_list).result %> - - set_need_rename_set_status_failed: - on-success: notify_zaqar - publish: - status: FAILED - message: <% task(set_need_rename).result %> - - copy_to_new_name_set_status_failed: - on-success: notify_zaqar - publish: - status: FAILED - message: <% task(copy_to_new_name).result %> - - remove_old_name_set_status_failed: - on-success: notify_zaqar - publish: - status: FAILED - message: <% task(remove_old_name).result %> - - notify_zaqar: - workflow: tripleo.messaging.v1.send - input: - queue_name: <% $.queue_name %> - type: <% execution().name %> - status: <% $.get('status', 'SUCCESS') %> - message: <% $.get('message', '') %> - execution: <% execution() %>