Merge "[ffwd] Rework checks for hybrid state containers" into stable/train
This commit is contained in:
commit
5197e4c2cc
|
@ -181,20 +181,34 @@ outputs:
|
|||
- iscsi_service_enabled_result is changed
|
||||
- iscsi_service_enabled_result.rc == 0
|
||||
upgrade_tasks:
|
||||
# nova_hybrid_state
|
||||
- name: Gather missing facts
|
||||
setup:
|
||||
gather_subset: "distribution"
|
||||
when: >-
|
||||
ansible_facts['distribution'] is not defined or
|
||||
ansible_facts['distribution_major_version'] is not defined
|
||||
tags:
|
||||
- never
|
||||
- nova_hybrid_state
|
||||
- name: Switch iscsid to hybrid state
|
||||
vars:
|
||||
iscsid_image: {get_param: ContainerIscsidImage}
|
||||
tags:
|
||||
- never
|
||||
- nova_hybrid_state
|
||||
when: step|int == 0
|
||||
when:
|
||||
- step|int == 0
|
||||
- ansible_facts['distribution'] == 'RedHat'
|
||||
- ansible_facts['distribution_major_version'] is version('7', '==')
|
||||
block:
|
||||
- name: Check if we need to create iscsid paunch config
|
||||
stat:
|
||||
path: /var/lib/tripleo-config/docker-container-hybrid_iscsid.json
|
||||
- name: Check if iscsid is running with proper image
|
||||
shell: |
|
||||
docker ps | grep "{{iscsid_image}}"
|
||||
failed_when: false
|
||||
register: hybrid_iscsid
|
||||
- name: Implement the hybrid state (only if the compute is still Queens)
|
||||
when: not hybrid_iscsid.stat.exists
|
||||
when: hybrid_iscsid.rc != 0
|
||||
block:
|
||||
- name: Update the iscsid paunch image in config
|
||||
shell: |
|
||||
|
@ -225,13 +239,24 @@ outputs:
|
|||
option: registries
|
||||
value: "{{ container_registry_insecure_registries }}"
|
||||
register: ini_read_result
|
||||
- name: Restart docker
|
||||
- name: Restart docker and apply the paunch config
|
||||
when:
|
||||
- container_registry_insecure_registries != []
|
||||
- ini_read_result is changed
|
||||
service:
|
||||
name: docker
|
||||
state: restarted
|
||||
shell: |
|
||||
set -o pipefail
|
||||
# Get list of running containers
|
||||
RUNNING="$( docker ps --format '{{ '{{' }}.Names{{ '}}' }}' )"
|
||||
# Restart docker
|
||||
systemctl restart docker
|
||||
# Compare running containers now vs before
|
||||
TO_STOP="$(grep -v -f <(echo "${RUNNING}") <(docker ps --format '{{ '{{' }}.Names{{ '}}' }}'))"
|
||||
# Check if we need to stop anything and stop it
|
||||
if [ -n "${TO_STOP}" ]; then
|
||||
echo "${TO_STOP}" | xargs -r docker stop
|
||||
fi
|
||||
args:
|
||||
executable: /usr/bin/bash
|
||||
- name: Remove iscsid container before applying new paunch config
|
||||
docker_container:
|
||||
name: iscsid
|
||||
|
|
|
@ -247,20 +247,34 @@ outputs:
|
|||
metadata_settings:
|
||||
get_attr: [NeutronBase, role_data, metadata_settings]
|
||||
upgrade_tasks:
|
||||
# nova_hybrid_state
|
||||
- name: Gather missing facts
|
||||
setup:
|
||||
gather_subset: "distribution"
|
||||
when: >-
|
||||
ansible_facts['distribution'] is not defined or
|
||||
ansible_facts['distribution_major_version'] is not defined
|
||||
tags:
|
||||
- never
|
||||
- nova_hybrid_state
|
||||
- name: Switch sriov-agent to hybrid state
|
||||
vars:
|
||||
neutron_sriov_image: {get_param: ContainerNeutronSriovImage}
|
||||
tags:
|
||||
- never
|
||||
- nova_hybrid_state
|
||||
when: step|int == 0
|
||||
when:
|
||||
- step|int == 0
|
||||
- ansible_facts['distribution'] == 'RedHat'
|
||||
- ansible_facts['distribution_major_version'] is version('7', '==')
|
||||
block:
|
||||
- name: Check if we need to create neutron_sriov paunch config
|
||||
stat:
|
||||
path: /var/lib/tripleo-config/docker-container-hybrid_neutron_sriov.json
|
||||
- name: Check if neutron_sriov is running with proper image
|
||||
shell: |
|
||||
docker ps | grep "{{neutron_sriov_image}}"
|
||||
failed_when: false
|
||||
register: hybrid_neutron_sriov
|
||||
- name: Implement the hybrid state for neutron_sriov_agent
|
||||
when: not hybrid_neutron_sriov.stat.exists
|
||||
when: hybrid_neutron_sriov != 0
|
||||
block:
|
||||
- name: Update the neutron_sriov_agent paunch image in config
|
||||
shell: |
|
||||
|
|
|
@ -1278,20 +1278,34 @@ outputs:
|
|||
- ksmtuned.service
|
||||
external_post_deploy_tasks: {get_attr: [NovaComputeCommon, nova_compute_common_deploy_steps_tasks]}
|
||||
upgrade_tasks:
|
||||
# nova_hybrid_state
|
||||
- name: Gather missing facts
|
||||
setup:
|
||||
gather_subset: "distribution"
|
||||
when: >-
|
||||
ansible_facts['distribution'] is not defined or
|
||||
ansible_facts['distribution_major_version'] is not defined
|
||||
tags:
|
||||
- never
|
||||
- nova_hybrid_state
|
||||
- name: Switch compute to hybrid state
|
||||
vars:
|
||||
nova_compute_image: {get_param: ContainerNovaComputeImage}
|
||||
tags:
|
||||
- never
|
||||
- nova_hybrid_state
|
||||
when: step|int == 0
|
||||
when:
|
||||
- step|int == 0
|
||||
- ansible_facts['distribution'] == 'RedHat'
|
||||
- ansible_facts['distribution_major_version'] is version('7', '==')
|
||||
block:
|
||||
- name: Check if we need to create nova_compute paunch config
|
||||
stat:
|
||||
path: /var/lib/tripleo-config/docker-container-hybrid_nova_compute.json
|
||||
- name: Check if nova_compute is running with proper image
|
||||
shell: |
|
||||
docker ps | grep "{{nova_compute_image}}"
|
||||
failed_when: false
|
||||
register: hybrid_nova_compute
|
||||
- name: Implement the hybrid state (only if the compute is still Queens)
|
||||
when: not hybrid_nova_compute.stat.exists
|
||||
when: hybrid_nova_compute.rc != 0
|
||||
block:
|
||||
- name: Update the nova_compute paunch image in config
|
||||
shell: |
|
||||
|
|
|
@ -378,12 +378,13 @@ outputs:
|
|||
- ansible_facts['distribution'] == 'RedHat'
|
||||
- ansible_facts['distribution_major_version'] is version('7', '==')
|
||||
block:
|
||||
- name: Check if we need to create ovn_controller paunch config
|
||||
stat:
|
||||
path: /var/lib/tripleo-config/docker-container-hybrid_ovn_controller.json
|
||||
- name: Check if ovn_controller is runing with proper image
|
||||
shell:
|
||||
docker ps | grep "{{ovn_controller_image}}"
|
||||
failed_when: false
|
||||
register: hybrid_ovn_controller
|
||||
- name: Implement the hybrid state for ovn_controller
|
||||
when: not hybrid_ovn_controller.stat.exists
|
||||
when: hybrid_ovn_controller.rc != 0
|
||||
block:
|
||||
- name: Update the ovn_controller paunch image in config
|
||||
shell: |
|
||||
|
|
Loading…
Reference in New Issue