Fix the nova reconfigure in the multinode env

Checking the fix condition first in the when clause rather than the
dynamic condition. Otherwise it will raise issue, especially in
multinode env.

For example use

  when:
    - nova_console == 'novnc'
    - inventory_hostname in groups['nova-novncproxy']

rather than

  when:
    - inventory_hostname in groups['nova-novncproxy']
    - nova_console == 'novnc'

Because the nova-novncproxy groups may do not exist.

Change-Id: I1e76ee239908a17a4c2ffd9a18c570fbc485172e
Closes-Bug: #1563643
This commit is contained in:
Jeffrey Zhang 2016-03-30 16:57:42 +08:00
parent 981d8206ab
commit 792e2c1f26
1 changed files with 15 additions and 15 deletions

View File

@ -74,8 +74,8 @@
failed_when: false
register: nova_compute_check_result
when:
- inventory_hostname in groups['compute']
- not enable_nova_fake | bool
- inventory_hostname in groups['compute']
- name: Check the configs in the nova_compute_ironic container
command: docker exec nova_compute_ironic /usr/local/bin/kolla_set_configs --check
@ -83,8 +83,8 @@
failed_when: false
register: nova_compute_ironic_check_result
when:
- inventory_hostname in groups['nova-compute-ironic']
- enable_ironic | bool
- inventory_hostname in groups['nova-compute-ironic']
- name: Check the configs in the nova_novncproxy container
command: docker exec nova_novncproxy /usr/local/bin/kolla_set_configs --check
@ -92,8 +92,8 @@
failed_when: false
register: nova_novncproxy_check_result
when:
- inventory_hostname in groups['nova-novncproxy']
- nova_console == 'novnc'
- inventory_hostname in groups['nova-novncproxy']
- name: Check the configs in the nova_spicehtml5proxy container
command: docker exec nova_spicehtml5proxy /usr/local/bin/kolla_set_configs --check
@ -101,8 +101,8 @@
failed_when: false
register: nova_spicehtml5proxy_check_result
when:
- inventory_hostname in groups['nova-spicehtml5proxy']
- nova_console == 'spice'
- inventory_hostname in groups['nova-spicehtml5proxy']
# NOTE(jeffrey4l): when config_strategy == 'COPY_ALWAYS'
# and container env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE',
@ -162,9 +162,9 @@
action: "remove_container"
register: remove_containers
when:
- inventory_hostname in groups[item[0]['group']]
- config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
- item[2]['rc'] == 1
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: nova_libvirt, group: compute },
{ name: nova_conductor, group: nova-conductor },
@ -180,10 +180,10 @@
action: "remove_container"
register: remove_nova_compute_container
when:
- not enable_nova_fake | bool
- inventory_hostname in groups['compute']
- config_strategy == 'COPY_ONCE' or nova_compute_container_env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
- nova_compute_check_result['rc'] == 1
- inventory_hostname in groups['compute']
- not enable_nova_fake | bool
- name: Remove nova_compute_ironic container
kolla_docker:
@ -192,9 +192,9 @@
register: remove_nova_compute_ironic_container
when:
- enable_ironic | bool
- inventory_hostname in groups['nova-compute-ironic']
- config_strategy == 'COPY_ONCE' or nova_compute_ironic_container_env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
- nova_compute_ironic_check_result['rc'] == 1
- inventory_hostname in groups['nova-compute-ironic']
- name: Remove nova_novncproxy container
kolla_docker:
@ -203,9 +203,9 @@
register: remove_nova_novncproxy_container
when:
- nova_console == 'novnc'
- inventory_hostname in groups['nova-novncproxy']
- config_strategy == 'COPY_ONCE' or nova_novncproxy_container_env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
- nova_novncproxy_check_result['rc'] == 1
- inventory_hostname in groups['nova-novncproxy']
- name: Remove nova_spicehtml5proxy container
kolla_docker:
@ -214,9 +214,9 @@
register: remove_nova_spicehtml5proxy_container
when:
- nova_console == 'spice'
- inventory_hostname in groups['nova-spicehtml5proxy']
- config_strategy == 'COPY_ONCE' or nova_spicehtml5proxy_container_env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
- nova_spicehtml5proxy_check_result['rc'] == 1
- inventory_hostname in groups['nova-spicehtml5proxy']
- include: start.yml
when: remove_containers.changed
@ -252,9 +252,9 @@
action: "restart_container"
when:
- config_strategy == 'COPY_ALWAYS'
- inventory_hostname in groups[item[0]['group']]
- item[1]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- item[2]['rc'] == 1
- inventory_hostname in groups[item[0]['group']]
with_together:
- [{ name: nova_libvirt, group: compute },
{ name: nova_conductor, group: nova-conductor },
@ -271,9 +271,9 @@
when:
- not enable_nova_fake | bool
- config_strategy == 'COPY_ALWAYS'
- inventory_hostname in groups['compute']
- nova_compute_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- nova_compute_check_result['rc'] == 1
- inventory_hostname in groups['compute']
- name: Restart the nova_compute_ironic container
kolla_docker:
@ -282,9 +282,9 @@
when:
- enable_ironic | bool
- config_strategy == 'COPY_ALWAYS'
- inventory_hostname in groups['nova-compute-ironic']
- nova_compute_ironic_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- nova_compute_ironic_check_result['rc'] == 1
- inventory_hostname in groups['nova-compute-ironic']
- name: Restart the nova_novncproxy container
kolla_docker:
@ -293,9 +293,9 @@
when:
- nova_console == 'novnc'
- config_strategy == 'COPY_ALWAYS'
- inventory_hostname in groups['nova-novncproxy']
- nova_novncproxy_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- nova_novncproxy_check_result['rc'] == 1
- inventory_hostname in groups['nova-novncproxy']
- name: Restart the nova_spicehtml5proxy container
kolla_docker:
@ -304,6 +304,6 @@
when:
- nova_console == 'spice'
- config_strategy == 'COPY_ALWAYS'
- inventory_hostname in groups['nova-spicehtml5proxy']
- nova_spicehtml5proxy_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- nova_spicehtml5proxy_check_result['rc'] == 1
- inventory_hostname in groups['nova-spicehtml5proxy']