From 5668e5f7674c7feb6cb3272964fdb04144074e15 Mon Sep 17 00:00:00 2001 From: Matthew Mosesohn Date: Fri, 29 Jul 2016 12:46:24 +0300 Subject: [PATCH] Fix etcd restart and handler systemd tasks Changed Wants=docker.service to docker.socket Renamed handlers for reloading systemd to contain role in task name. --- roles/docker/handlers/main.yml | 8 ++++---- roles/etcd/handlers/main.yml | 6 +++--- roles/etcd/templates/etcd-docker.service.j2 | 2 +- roles/etcd/templates/etcd-proxy-docker.service.j2 | 2 +- roles/kubernetes/node/handlers/main.yml | 8 ++++---- roles/network_plugin/calico/handlers/main.yml | 10 +++++----- .../calico/templates/calico-node.service.j2 | 2 +- roles/network_plugin/flannel/handlers/main.yml | 12 ++++++------ roles/network_plugin/weave/handlers/main.yml | 14 +++++++------- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/roles/docker/handlers/main.yml b/roles/docker/handlers/main.yml index 4153d123d..79db42f92 100644 --- a/roles/docker/handlers/main.yml +++ b/roles/docker/handlers/main.yml @@ -2,14 +2,14 @@ - name: restart docker command: /bin/true notify: - - reload systemd - - reload docker + - Docker | reload systemd + - Docker | reload docker -- name : reload systemd +- name : Docker | reload systemd shell: systemctl daemon-reload when: ansible_service_mgr == "systemd" -- name: reload docker +- name: Docker | reload docker service: name: docker state: restarted diff --git a/roles/etcd/handlers/main.yml b/roles/etcd/handlers/main.yml index bb32d4e8e..693754a06 100644 --- a/roles/etcd/handlers/main.yml +++ b/roles/etcd/handlers/main.yml @@ -2,18 +2,18 @@ - name: restart etcd command: /bin/true notify: - - reload systemd + - etcd | reload systemd - reload etcd - wait for etcd up - name: restart etcd-proxy command: /bin/true notify: - - reload systemd + - etcd | reload systemd - reload etcd-proxy - wait for etcd up -- name: reload systemd +- name: etcd | reload systemd command: systemctl daemon-reload when: ansible_service_mgr == "systemd" diff --git a/roles/etcd/templates/etcd-docker.service.j2 b/roles/etcd/templates/etcd-docker.service.j2 index e196c0b59..a37759fec 100644 --- a/roles/etcd/templates/etcd-docker.service.j2 +++ b/roles/etcd/templates/etcd-docker.service.j2 @@ -1,6 +1,6 @@ [Unit] Description=etcd docker wrapper -Wants=docker.service +Wants=docker.socket After=docker.service [Service] diff --git a/roles/etcd/templates/etcd-proxy-docker.service.j2 b/roles/etcd/templates/etcd-proxy-docker.service.j2 index 98d548cce..bf70f0e7f 100644 --- a/roles/etcd/templates/etcd-proxy-docker.service.j2 +++ b/roles/etcd/templates/etcd-proxy-docker.service.j2 @@ -1,6 +1,6 @@ [Unit] Description=etcd-proxy docker wrapper -Wants=docker.service +Wants=docker.socket After=docker.service [Service] diff --git a/roles/kubernetes/node/handlers/main.yml b/roles/kubernetes/node/handlers/main.yml index 6be44279d..5991bebf3 100644 --- a/roles/kubernetes/node/handlers/main.yml +++ b/roles/kubernetes/node/handlers/main.yml @@ -2,14 +2,14 @@ - name: restart kubelet command: /bin/true notify: - - reload systemd - - reload kubelet + - Kubelet | reload systemd + - Kubelet | reload kubelet -- name: reload systemd +- name: Kubelet | reload systemd command: systemctl daemon-reload when: ansible_service_mgr == "systemd" -- name: reload kubelet +- name: Kubelet | reload kubelet service: name: kubelet state: restarted diff --git a/roles/network_plugin/calico/handlers/main.yml b/roles/network_plugin/calico/handlers/main.yml index 1e8d56dbe..d4059c412 100644 --- a/roles/network_plugin/calico/handlers/main.yml +++ b/roles/network_plugin/calico/handlers/main.yml @@ -2,15 +2,15 @@ - name: restart calico-node command: /bin/true notify: - - reload systemd - - reload calico-node + - Calico | reload systemd + - Calico | reload calico-node -- name : reload systemd +- name : Calico | reload systemd shell: systemctl daemon-reload when: ansible_service_mgr == "systemd" -- name: reload calico-node +- name: Calico | reload calico-node service: name: calico-node state: restarted - sleep: 10 \ No newline at end of file + sleep: 10 diff --git a/roles/network_plugin/calico/templates/calico-node.service.j2 b/roles/network_plugin/calico/templates/calico-node.service.j2 index 191ae8f40..115da35ae 100644 --- a/roles/network_plugin/calico/templates/calico-node.service.j2 +++ b/roles/network_plugin/calico/templates/calico-node.service.j2 @@ -1,8 +1,8 @@ [Unit] Description=Calico per-node agent Documentation=https://github.com/projectcalico/calico-docker -Wants=docker.service etcd-proxy.service After=docker.service etcd-proxy.service +Wants=docker.socket [Service] User=root diff --git a/roles/network_plugin/flannel/handlers/main.yml b/roles/network_plugin/flannel/handlers/main.yml index cb3986312..1982765d4 100644 --- a/roles/network_plugin/flannel/handlers/main.yml +++ b/roles/network_plugin/flannel/handlers/main.yml @@ -7,20 +7,20 @@ - name: restart docker command: /bin/true notify: - - reload systemd - - reload docker - - reload kubelet + - Flannel | reload systemd + - Flannel | reload docker + - Flannel | reload kubelet -- name : reload systemd +- name : Flannel | reload systemd shell: systemctl daemon-reload when: ansible_service_mgr == "systemd" -- name: reload docker +- name: Flannel | reload docker service: name: docker state: restarted -- name: reload kubelet +- name: Flannel | reload kubelet service: name: kubelet state: restarted diff --git a/roles/network_plugin/weave/handlers/main.yml b/roles/network_plugin/weave/handlers/main.yml index 3bb21c346..bd20781ee 100644 --- a/roles/network_plugin/weave/handlers/main.yml +++ b/roles/network_plugin/weave/handlers/main.yml @@ -2,32 +2,32 @@ - name: restart docker command: /bin/true notify: - - reload systemd - - reload docker + - Weave | reload systemd + - Weave | reload docker -- name : reload systemd +- name : Weave | reload systemd shell: systemctl daemon-reload when: ansible_service_mgr == "systemd" - name: restart weave command: /bin/true notify: - - reload systemd + - Weave | reload systemd - reload weave - name: restart weaveproxy command: /bin/true notify: - - reload systemd + - Weave | reload systemd - reload weaveproxy - name: restart weaveexpose command: /bin/true notify: - - reload systemd + - Weave | reload systemd - reload weaveexpose -- name: reload docker +- name: Weave | reload docker service: name: docker state: restarted