Browse Source

Merge pull request #5680 from mgugino-upstream-stage/ensure-docker-restarts-with-iptables

Automatic merge from submit-queue.

Ensure docker is restarted when iptables is restarted

Currently, os_firewall role may run after docker role,
and iptables.service may be restarted.  When restarted,
this negatively impacts docker's iptables rules.

This commit ensures that if iptables is restarted,
docker is restarted as well (by systemd)

Fixes: https://github.com/openshift/origin/issues/16709
OpenShift Merge Robot 7 years ago
parent
commit
707be43d8e
2 changed files with 4 additions and 1 deletions
  1. 1 0
      roles/docker/handlers/main.yml
  2. 3 1
      roles/docker/tasks/package_docker.yml

+ 1 - 0
roles/docker/handlers/main.yml

@@ -4,6 +4,7 @@
   systemd:
     name: "{{ openshift.docker.service_name }}"
     state: restarted
+    daemon_reload: yes
   register: r_docker_restart_docker_result
   until: not r_docker_restart_docker_result | failed
   retries: 3

+ 3 - 1
roles/docker/tasks/package_docker.yml

@@ -48,7 +48,9 @@
     template:
       dest: "{{ docker_systemd_dir }}/custom.conf"
       src: custom.conf.j2
-  when: not os_firewall_use_firewalld | default(False) | bool
+    notify:
+    - restart docker
+  when: not (os_firewall_use_firewalld | default(False)) | bool
 
 - name: Add enterprise registry, if necessary
   set_fact: