Merge "Set ODL API restart policy to unless-stopped" into stable/queens

This commit is contained in:
Zuul 2018-06-29 06:11:20 +00:00 committed by Gerrit Code Review
commit a9d60e11a5
1 changed files with 19 additions and 1 deletions

View File

@ -127,7 +127,7 @@ outputs:
net: host
detach: true
user: odl
restart: always
restart: unless-stopped
healthcheck:
test: /openstack/healthcheck
volumes:
@ -185,6 +185,15 @@ outputs:
# Containerized deployment upgrade steps
- name: ODL container L2 update and upgrade tasks
block: &odl_container_upgrade_tasks
- name: Check if ODL container is present
shell: "docker ps -a --format '{{ '{{' }}.Names{{ '}}' }}' | grep '^opendaylight_api$'"
register: opendaylight_api_container_present
failed_when: false
# NOTE: using shell module because of
# https://github.com/ansible/ansible/issues/27960
- name: Update ODL container restart policy to unless-stopped
shell: "docker update --restart=unless-stopped opendaylight_api"
when: opendaylight_api_container_present.rc == 0
- name: stop previous ODL container
docker_container:
name: opendaylight_api
@ -242,6 +251,15 @@ outputs:
odl_update_level: {get_param: ODLUpdateLevel}
- name: Stop ODL container and remove cache
block:
- name: Check if ODL container is present
shell: "docker ps -a --format '{{ '{{' }}.Names{{ '}}' }}' | grep '^opendaylight_api$'"
register: opendaylight_api_container_present
failed_when: false
# NOTE: using shell module because of
# https://github.com/ansible/ansible/issues/27960
- name: Update ODL container restart policy to unless-stopped
shell: "docker update --restart=unless-stopped opendaylight_api"
when: opendaylight_api_container_present.rc == 0
- name: Stop previous ODL container
docker_container:
name: opendaylight_api