Map instances to cell_v2 only once.

If nova-manage cell_v2 create_cell returns 2, it's because the cell already
exists and all instances are correctly mapped to the cell. The cell_v2
map_instances doesn't need to run.

Change-Id: I38002a18dff4dbd44bd3df9e1969c9d50ab12705
Related-Bug: 1729661
(cherry picked from commit 0f24bb8bd4)
This commit is contained in:
Marc Gariepy 2018-07-18 09:56:47 -04:00 committed by Jesse Pretorius (odyssey4me)
parent abaa68783c
commit 7e0d6b5477
1 changed files with 2 additions and 0 deletions

View File

@ -82,9 +82,11 @@
become_user: "{{ nova_system_user_name }}"
register: cell1_uuid
changed_when: false
when: "nova_cell1_create.rc == 0"
- name: Map instances to new Cell1
command: "{{ nova_bin }}/nova-manage cell_v2 map_instances --cell_uuid {{ cell1_uuid['stdout'].split()[3] }}"
become: yes
become_user: "{{ nova_system_user_name }}"
changed_when: false
when: "nova_cell1_create.rc == 0"