summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2017-10-09 12:58:40 -0400
committerMichael Gugino <mgugino@redhat.com>2017-10-09 12:58:40 -0400
commit91892aad5f5225daead96cb9dd8f7263f0212a2b (patch)
treea60f7d8ecf956e93ba0ab364ba3f3603cadd9834
parent3038a601d1d51fdc9f1698d03a54ecac68251c88 (diff)
downloadopenshift-91892aad5f5225daead96cb9dd8f7263f0212a2b.tar.gz
openshift-91892aad5f5225daead96cb9dd8f7263f0212a2b.tar.bz2
openshift-91892aad5f5225daead96cb9dd8f7263f0212a2b.tar.xz
openshift-91892aad5f5225daead96cb9dd8f7263f0212a2b.zip
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
-rw-r--r--roles/docker/templates/custom.conf.j26
1 files changed, 6 insertions, 0 deletions
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