From 649fdfbaf5526f51531169e49732bd64deccc26e Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Fri, 5 Apr 2019 19:40:21 +0100
Subject: [PATCH] Remove placement migration code

These tasks were only necessary for migrating placement from nova to a
separate service. Since the stable/stein branch has been cut, it is safe
to remove these migration tasks in master.

Change-Id: I4d477efad7ab6247aaff57d31ee83e137eb3f796
---
 ansible/roles/placement/tasks/bootstrap.yml | 28 ---------------------
 ansible/roles/placement/tasks/upgrade.yml   |  8 ------
 2 files changed, 36 deletions(-)

diff --git a/ansible/roles/placement/tasks/bootstrap.yml b/ansible/roles/placement/tasks/bootstrap.yml
index 062880778..922f54966 100644
--- a/ansible/roles/placement/tasks/bootstrap.yml
+++ b/ansible/roles/placement/tasks/bootstrap.yml
@@ -33,33 +33,5 @@
     - database.changed
     - not use_preconfigured_databases | bool
 
-# TODO(egonzalez): Remove this task once stein is release as will not be required to migrate data.
-# Error codes https://github.com/openstack/placement/blob/master/tools/mysql-migrate-db.sh#L230
-- name: Migrate placement database
-  vars:
-    placement_api: "{{ placement_services['placement-api'] }}"
-  become: true
-  kolla_docker:
-    action: "start_container"
-    command: bash -c 'sudo -E kolla_set_configs && bash /opt/mysql-migrate-db.sh --migrate /etc/placement/migrate-db.rc'
-    common_options: "{{ docker_common_options }}"
-    detach: False
-    image: "{{ placement_api.image }}"
-    labels:
-      BOOTSTRAP:
-    name: "migrate_placement_database"
-    restart_policy: "never"
-    volumes: "{{ placement_api.volumes|reject('equalto', '')|list }}"
-  register: migrate_placement
-  changed_when:
-    - migrate_placement is success
-    - migrate_placement.rc == 0
-  failed_when:
-    - migrate_placement.rc not in [0, 3, 4]
-  run_once: True
-  delegate_to: "{{ groups[placement_api.group][0] }}"
-  when:
-    - kolla_action == "upgrade"
-
 - include_tasks: bootstrap_service.yml
   when: database.changed or use_preconfigured_databases | bool
diff --git a/ansible/roles/placement/tasks/upgrade.yml b/ansible/roles/placement/tasks/upgrade.yml
index 67e66dc7c..96f61d722 100644
--- a/ansible/roles/placement/tasks/upgrade.yml
+++ b/ansible/roles/placement/tasks/upgrade.yml
@@ -5,14 +5,6 @@
 - include_tasks: clone.yml
   when: placement_dev_mode | bool
 
-# TODO(mgoddard): Remove this in Train once all old containers have been
-# stopped.
-- name: "Stopping old placement-api containers"
-  kolla_docker:
-    action: "stop_container"
-    common_options: "{{ docker_common_options }}"
-    name: "placement_api"
-
 - include_tasks: config.yml
 
 - include_tasks: bootstrap.yml
-- 
GitLab