openstack-ansible-os_nova/tasks/nova_db_post_setup.yml
Jean-Philippe Evrard d43ca20e24 Remove {{ in when
Cleaning up the warnings like:

[WARNING]: when statements should not include jinja2 templating
delimiters such as {{ }} or {% %}.
Found: {{ nova_cell1_create.rc == 0 }}

Change-Id: Ibfd89123b2c9b2b2e1eab89e2dc9392999b150dd
2017-05-31 16:14:54 +00:00

59 lines
1.9 KiB
YAML

---
# Copyright 2017, Rackspace US, Inc.
#
# 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.
# This needs to be done after Compute hosts are added.
- name: Perform a cell_v2 discover
command: "{{ nova_bin }}/nova-manage cell_v2 discover_hosts"
become: yes
become_user: "{{ nova_system_user_name }}"
changed_when: false
tags:
- nova-db-setup
- nova-setup
- nova-command-bin
# When upgrading we need to map existing instances to the new cell1
# To do this we need the cell UUID.
- name: Get UUID of new Nova Cell
shell: "{{ nova_bin }}/nova-manage --config-file /etc/nova/nova.conf cell_v2 list_cells | awk '/{{ nova_cell1_name }}/ {print $4}'"
become: yes
become_user: "{{ nova_system_user_name }}"
when: "nova_cell1_create.rc == 0"
register: cell1_uuid
tags:
- nova-db-setup
- nova-setup
- nova-command-bin
- name: Map instances to new Cell1
command: "{{ nova_bin }}/nova-manage --config-file /etc/nova/nova.conf cell_v2 map_instances --cell_uuid {{ cell1_uuid.stdout }}"
become: yes
become_user: "{{ nova_system_user_name }}"
when: "nova_cell1_create.rc == 0"
tags:
- nova-db-setup
- nova-setup
- nova-command-bin
- name: Perform Nova online data migrations
command: "{{ nova_bin }}/nova-manage --config-file /etc/nova/nova.conf db online_data_migrations"
become: yes
become_user: "{{ nova_system_user_name }}"
changed_when: false
tags:
- nova-db-setup
- nova-setup
- nova-command-bin