Skip to content
Snippets Groups Projects
Commit 30cc7c84 authored by Josh Lothian's avatar Josh Lothian
Browse files

Reconfigure docker restart behavior on atomic

Before restarting docker, instruct it to kill running
containers when it restarts.

Needs a second docker restart after we restore the original
behavior, otherwise the next time docker is restarted by
an operator, it will unexpectedly bring down all running
containers.
parent a5bb24b8
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,9 @@
notify:
- Flannel | reload systemd
- Flannel | reload docker.socket
- Flannel | reconfigure docker restart behavior (atomic)
- Flannel | reload docker
- Flannel | restore docker restart behavior (atomic)
- Flannel | reload docker (atomic)
- Flannel | pause while Docker restarts
- Flannel | wait for docker
......@@ -23,14 +25,29 @@
state: restarted
when: ansible_os_family in ['CoreOS', 'Container Linux by CoreOS']
- name: Flannel | reconfigure docker restart behavior (atomic)
replace:
name: /etc/docker/daemon.json
regexp: '"live-restore":.*true'
replace: '"live-restore": false'
when: is_atomic
- name: Flannel | reload docker
service:
name: docker
state: restarted
when: not is_atomic
- name: Flannel | restore docker restart behavior (atomic)
replace:
name: /etc/docker/daemon.json
regexp: '"live-restore": false'
replace: '"live-restore": true'
when: is_atomic
- name: Flannel | reload docker (atomic)
shell: systemctl stop docker && runc list | awk '!/ID/ {print $1}' | xargs -n 1 -I ID runc kill ID KILL && systemctl start docker
service:
name: docker
state: restarted
when: is_atomic
- name: Flannel | pause while Docker restarts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment