Mohammed Naser | 0a13cee | 2023-03-02 11:28:29 +0100 | [diff] [blame] | 1 | # Copyright (c) 2023 VEXXHOST, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | - name: Generate configuration difference |
| 16 | ansible.builtin.include_role: |
| 17 | name: osa_config_diff |
| 18 | vars: |
| 19 | osa_config_diff_containers_group: cinder_volume |
| 20 | osa_config_diff_chart_ref: "{{ cinder_helm_chart_ref }}" |
| 21 | osa_config_diff_release_namespace: "{{ cinder_helm_release_namespace }}" |
| 22 | osa_config_diff_release_values: "{{ _cinder_helm_values | combine(cinder_helm_values, recursive=True) }}" |
| 23 | osa_config_diff_config_files: |
| 24 | backends.conf: /etc/cinder/cinder.conf |
| 25 | cinder.conf: /etc/cinder/cinder.conf |
| 26 | |
| 27 | - name: Turn off the "cinder-volume" service |
| 28 | run_once: true |
| 29 | delegate_to: "{{ item }}" |
| 30 | ansible.builtin.service: |
| 31 | name: cinder-volume |
| 32 | state: stopped |
| 33 | enabled: false |
| 34 | loop: "{{ groups['cinder_volume'] }}" |
| 35 | |
| 36 | - name: Turn off the "cinder-backup" service |
| 37 | run_once: true |
| 38 | delegate_to: "{{ item }}" |
| 39 | ansible.builtin.service: |
| 40 | name: cinder-backup |
| 41 | state: stopped |
| 42 | enabled: false |
| 43 | loop: "{{ groups['cinder_backup'] }}" |
| 44 | |
| 45 | - name: Migrate the database |
| 46 | ansible.builtin.include_role: |
| 47 | name: migrate_db_from_osa |
| 48 | vars: |
| 49 | migrate_db_from_osa_pxc_namespace: "{{ cinder_helm_release_namespace }}" |
| 50 | migrate_db_from_osa_containers_group: cinder_all |
| 51 | migrate_db_from_osa_databases: |
| 52 | cinder: cinder |
| 53 | |
| 54 | - name: Run deployment flow |
| 55 | ansible.builtin.import_tasks: |
| 56 | file: main.yml |
| 57 | |
| 58 | - name: Migrate HAproxy |
| 59 | ansible.builtin.include_role: |
| 60 | name: migrate_haproxy_from_osa |
| 61 | vars: |
| 62 | migrate_haproxy_from_osa_group: cinder_all |
| 63 | migrate_haproxy_from_osa_service_namespace: "{{ cinder_helm_release_namespace }}" |
| 64 | migrate_haproxy_from_osa_service_name: cinder-api |
| 65 | migrate_haproxy_from_osa_haproxy_backend: cinder_api |