[queens only] Keep ceph and neutron side containers running during Update

If docker package gets updated we just stop docker containers. This
causes minor outage in ceph which it recovers from but it also
causes outage in neutron which it never recovers from unless the
routers get recreated.

Closes-Bug: #1851872
Change-Id: I3457dd4c936798299e78fc13b2c06e158ed26f45
This commit is contained in:
Lukas Bezdicka 2019-11-08 19:19:51 +01:00 committed by Alex Schultz
parent 456f2355f5
commit 3e2f565841
1 changed files with 8 additions and 2 deletions

View File

@ -160,10 +160,16 @@ outputs:
set_fact: docker_rpm_needs_update={{ docker_check_update.rc == 100 }} set_fact: docker_rpm_needs_update={{ docker_check_update.rc == 100 }}
- name: Set puppet_docker_is_outofsync fact - name: Set puppet_docker_is_outofsync fact
set_fact: puppet_docker_is_outofsync={{ puppet_docker_noop_output.stdout|trim|int >= 1 }} set_fact: puppet_docker_is_outofsync={{ puppet_docker_noop_output.stdout|trim|int >= 1 }}
- name: Stop all containers - name: Stop all containers except ceph or neutron side containers
# xargs is preferable to docker stop $(docker ps -q) as that might generate a # xargs is preferable to docker stop $(docker ps -q) as that might generate a
# a too long command line # a too long command line
shell: docker ps -q | xargs --no-run-if-empty -n1 docker stop # We need to make sure connectivity stays by keeping alive ceph and the side containers
shell: |
{% raw %}
docker ps --format "{{.ID}} {{.Names}}" | grep -v ceph- |\
grep -v neutron-.*qdhcp | grep -v neutron-.*qrouter | grep -v neutron-radvd |\
awk '{print $1}' | xargs --no-run-if-empty docker stop
{% endraw %}
# If we ship a config change which requires docker restart, change the when condition: # If we ship a config change which requires docker restart, change the when condition:
# when: puppet_docker_is_outofsync or docker_rpm_needs_update # when: puppet_docker_is_outofsync or docker_rpm_needs_update
when: docker_rpm_needs_update when: docker_rpm_needs_update