From 91892aad5f5225daead96cb9dd8f7263f0212a2b Mon Sep 17 00:00:00 2001 From: Michael Gugino Date: Mon, 9 Oct 2017 12:58:40 -0400 Subject: Add PartOf to docker systemd service unit. Currently, if iptables service is restarted, existing iptables rules are removed. Docker adds iptables rules dyanmically upon startup and container creation. Restarting the iptables service results in a loss of these needed iptables rules. This commit ensures that if iptables service is restarted by anisble or the user, docker is also restarted. This ensures the proper dynamic iptables rules are in place for docker. Fixes: openshift/origin#16709 --- roles/docker/templates/custom.conf.j2 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'roles') diff --git a/roles/docker/templates/custom.conf.j2 b/roles/docker/templates/custom.conf.j2 index 9b47cb6ab..713412473 100644 --- a/roles/docker/templates/custom.conf.j2 +++ b/roles/docker/templates/custom.conf.j2 @@ -3,3 +3,9 @@ [Unit] Wants=iptables.service After=iptables.service + +# The following line is a work-around to ensure docker is restarted whenever +# iptables is restarted. This ensures the proper iptables rules will be in +# place for docker. +# Note: This will also cause docker to be stopped if iptables is stopped. +PartOf=iptables.service -- cgit v1.2.1