Do not create temporary swift URLS for ceph-ansible

The state information in the ceph-ansible fetch directory
is no longer necessary to replace a Ceph monitor as of
ceph-ansible 4.0.14-1. Stein, Train, Ussuri and newer
should be using this version of ceph-ansible or newer.
TripleO does not need to do extra work to maintain the
fetch directory.

This means that the plan_management workbook no longer
needs to create the SwiftFetchDirGetTempurl and the
SwiftFetchDirPutTempurl parameters. This patch removes
the create_ceph_ansible_fetch_directory_backup_plan
task which creates them. It also removes the workbook
rename_ceph_ansible_fetch_directory.

Both Icce658f803a608ee4b7df34b0b8297ecabcdb0ee and
Ifab82c9a5b0a206c14ae7976d2c1c7f0e9fa3d9d are effectively
reverted of their ceph aspects with this change, but this
change should not be backported to Rocky or older because
ceph-ansible 3 still needs the fetch directory.

Change-Id: I167449e4d7e38f0f5fd74251a3bd8f5b0b31451b
Related-Bug: #1863809
This commit is contained in:
John Fulton 2020-02-21 21:24:10 +00:00
parent bbb3d193b7
commit a54dc49bba
3 changed files with 3 additions and 159 deletions

View File

@ -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

View File

@ -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:

View File

@ -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() %>