Merge "Fix the nova reconfig not work issue"

This commit is contained in:
Jenkins 2016-03-13 16:27:57 +00:00 committed by Gerrit Code Review
commit e482947165

View File

@ -20,8 +20,8 @@
register: container_state register: container_state
failed_when: container_state.Running == false failed_when: container_state.Running == false
when: when:
- inventory_hostname in groups['compute']
- not enable_nova_fake | bool - not enable_nova_fake | bool
- inventory_hostname in groups['compute']
- name: Ensuring the nova_compute_ironic container is up - name: Ensuring the nova_compute_ironic container is up
kolla_docker: kolla_docker:
@ -30,8 +30,8 @@
register: container_state register: container_state
failed_when: container_state.Running == false failed_when: container_state.Running == false
when: when:
- inventory_hostname in groups['nova-compute-ironic']
- enable_ironic | bool - enable_ironic | bool
- inventory_hostname in groups['nova-compute-ironic']
- name: Ensuring the nova_novncproxy container is up - name: Ensuring the nova_novncproxy container is up
kolla_docker: kolla_docker:
@ -40,8 +40,8 @@
register: container_state register: container_state
failed_when: container_state.Running == false failed_when: container_state.Running == false
when: when:
- inventory_hostname in groups['nova-novncproxy']
- nova_console == 'novnc' - nova_console == 'novnc'
- inventory_hostname in groups['nova-novncproxy']
- name: Ensuring the nova_spicehtml5proxy container is up - name: Ensuring the nova_spicehtml5proxy container is up
kolla_docker: kolla_docker:
@ -50,8 +50,8 @@
register: container_state register: container_state
failed_when: container_state.Running == false failed_when: container_state.Running == false
when: when:
- inventory_hostname in groups['nova-spicehtml5proxy']
- nova_console == 'spice' - nova_console == 'spice'
- inventory_hostname in groups['nova-spicehtml5proxy']
- include: config.yml - include: config.yml
@ -72,6 +72,7 @@
command: docker exec nova_compute /usr/local/bin/kolla_set_configs --check command: docker exec nova_compute /usr/local/bin/kolla_set_configs --check
changed_when: false changed_when: false
failed_when: false failed_when: false
register: nova_compute_check_result
when: when:
- inventory_hostname in groups['compute'] - inventory_hostname in groups['compute']
- not enable_nova_fake | bool - not enable_nova_fake | bool
@ -80,6 +81,7 @@
command: docker exec nova_compute_ironic /usr/local/bin/kolla_set_configs --check command: docker exec nova_compute_ironic /usr/local/bin/kolla_set_configs --check
changed_when: false changed_when: false
failed_when: false failed_when: false
register: nova_compute_ironic_check_result
when: when:
- inventory_hostname in groups['nova-compute-ironic'] - inventory_hostname in groups['nova-compute-ironic']
- enable_ironic | bool - enable_ironic | bool
@ -88,6 +90,7 @@
command: docker exec nova_novncproxy /usr/local/bin/kolla_set_configs --check command: docker exec nova_novncproxy /usr/local/bin/kolla_set_configs --check
changed_when: false changed_when: false
failed_when: false failed_when: false
register: nova_novncproxy_check_result
when: when:
- inventory_hostname in groups['nova-novncproxy'] - inventory_hostname in groups['nova-novncproxy']
- nova_console == 'novnc' - nova_console == 'novnc'
@ -96,6 +99,7 @@
command: docker exec nova_spicehtml5proxy /usr/local/bin/kolla_set_configs --check command: docker exec nova_spicehtml5proxy /usr/local/bin/kolla_set_configs --check
changed_when: false changed_when: false
failed_when: false failed_when: false
register: nova_spicehtml5proxy_check_result
when: when:
- inventory_hostname in groups['nova-spicehtml5proxy'] - inventory_hostname in groups['nova-spicehtml5proxy']
- nova_console == 'spice' - nova_console == 'spice'
@ -116,6 +120,42 @@
- { name: nova_consoleauth, group: nova-consoleauth } - { name: nova_consoleauth, group: nova-consoleauth }
- { name: nova_scheduler, group: nova-scheduler } - { name: nova_scheduler, group: nova-scheduler }
- name: Container config strategy for nova_compute
kolla_docker:
name: nova_compute
action: "get_container_env"
register: nova_compute_container_env
when:
- not enable_nova_fake | bool
- inventory_hostname in groups['compute']
- name: Container config strategy for nova_compute_ironic
kolla_docker:
name: nova_compute_ironic
action: "get_container_env"
register: nova_compute_ironic_container_env
when:
- enable_ironic | bool
- inventory_hostname in groups['nova-compute-ironic']
- name: Container config strategy for nova_novncproxy
kolla_docker:
name: nova_novncproxy
action: "get_container_env"
register: nova_novncproxy_container_env
when:
- nova_console == 'novnc'
- inventory_hostname in groups['nova-novncproxy']
- name: Container config strategy for nova_spicehtml5proxy
kolla_docker:
name: nova_spicehtml5proxy
action: "get_container_env"
register: nova_spicehtml5proxy
when:
- nova_console == 'spice'
- inventory_hostname in groups['nova-spicehtml5proxy']
- name: Remove the nova libvirt, conductor, api, consoleauth and scheduler containers - name: Remove the nova libvirt, conductor, api, consoleauth and scheduler containers
kolla_docker: kolla_docker:
name: "{{ item[0]['name'] }}" name: "{{ item[0]['name'] }}"
@ -134,9 +174,78 @@
- container_envs.results - container_envs.results
- check_results.results - check_results.results
- name: Remove nova_compute container
kolla_docker:
name: nova_compute
action: "remove_container"
register: remove_nova_compute_container
when:
- 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:
name: nova_compute_ironic
action: "remove_container"
register: remove_nova_compute_ironic_container
when:
- enable_ironic | bool
- 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:
name: nova_novncproxy
action: "remove_container"
register: remove_nova_novncproxy_container
when:
- nova_console == 'novnc'
- 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:
name: nova_spicehtml5proxy
action: "remove_container"
register: remove_nova_spicehtml5proxy_container
when:
- nova_console == 'spice'
- 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 - include: start.yml
when: remove_containers.changed when: remove_containers.changed
- include: start.yml
when:
- not enable_nova_fake | bool
- remove_nova_compute_container.changed
- include: start.yml
when:
- enable_ironic | bool
- remove_nova_compute_ironic_container.changed
- include: start.yml
when:
- enable_ironic | bool
- remove_nova_compute_ironic_container.changed
- include: start.yml
when:
- nova_console == 'novnc'
- remove_nova_novncproxy_container.changed
- include: start.yml
when:
- nova_console == 'spice'
- remove_nova_spicehtml5proxy_container.changed
- name: Restart the nova libvirt, conductor, api, consoleauth and scheduler containers - name: Restart the nova libvirt, conductor, api, consoleauth and scheduler containers
kolla_docker: kolla_docker:
name: "{{ item[0]['name'] }}" name: "{{ item[0]['name'] }}"
@ -160,53 +269,41 @@
name: "nova_compute" name: "nova_compute"
action: "restart_container" action: "restart_container"
when: when:
- config_strategy == 'COPY_ALWAYS'
- item[0]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- item[1]['rc'] == 1
- inventory_hostname in groups['compute']
- not enable_nova_fake | bool - not enable_nova_fake | bool
with_together: - config_strategy == 'COPY_ALWAYS'
- container_envs.results - nova_compute_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- check_results.results - nova_compute_check_result['rc'] == 1
- inventory_hostname in groups['compute']
- name: Restart the nova_compute_ironic container - name: Restart the nova_compute_ironic container
kolla_docker: kolla_docker:
name: "nova_compute_ironic" name: "nova_compute_ironic"
action: "restart_container" action: "restart_container"
when: when:
- config_strategy == 'COPY_ALWAYS'
- item[0]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- item[1]['rc'] == 1
- inventory_hostname in groups['nova-compute-ironic']
- enable_ironic | bool - enable_ironic | bool
with_together: - config_strategy == 'COPY_ALWAYS'
- container_envs.results - nova_compute_ironic_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- check_results.results - nova_compute_ironic_check_result['rc'] == 1
- inventory_hostname in groups['nova-compute-ironic']
- name: Restart the nova_novncproxy container - name: Restart the nova_novncproxy container
kolla_docker: kolla_docker:
name: "nova_novncproxy" name: "nova_novncproxy"
action: "restart_container" action: "restart_container"
when: when:
- config_strategy == 'COPY_ALWAYS'
- item[0]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- item[1]['rc'] == 1
- inventory_hostname in groups['nova-novncproxy']
- nova_console == 'novnc' - nova_console == 'novnc'
with_together: - config_strategy == 'COPY_ALWAYS'
- container_envs.results - nova_novncproxy_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- check_results.results - nova_novncproxy_check_result['rc'] == 1
- inventory_hostname in groups['nova-novncproxy']
- name: Restart the nova_spicehtml5proxy container - name: Restart the nova_spicehtml5proxy container
kolla_docker: kolla_docker:
name: "nova_spicehtml5proxy" name: "nova_spicehtml5proxy"
action: "restart_container" action: "restart_container"
when: when:
- config_strategy == 'COPY_ALWAYS'
- item[0]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- item[1]['rc'] == 1
- inventory_hostname in groups['nova-spicehtml5proxy']
- nova_console == 'spice' - nova_console == 'spice'
with_together: - config_strategy == 'COPY_ALWAYS'
- container_envs.results - nova_spicehtml5proxy_container_env['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- check_results.results - nova_spicehtml5proxy_check_result['rc'] == 1
- inventory_hostname in groups['nova-spicehtml5proxy']