Browse Source

review handlers for sysvinit

pull/42/head
Smaine Kahlouch 9 years ago
parent
commit
29bf90a858
4 changed files with 22 additions and 32 deletions
  1. 17
      roles/kubernetes/master/handlers/main.yml
  2. 12
      roles/kubernetes/node/handlers/main.yml
  3. 9
      roles/kubernetes/node/tasks/install.yml
  4. 16
      roles/network_plugin/handlers/main.yml

17
roles/kubernetes/master/handlers/main.yml

@ -2,24 +2,13 @@
- name: reload systemd
command: systemctl daemon-reload
- name: restart kubelet
- name: restart systemd-kubelet
command: /bin/true
notify:
- reload systemd
- restart reloaded-kubelet
- restart kubelet
- name: restart reloaded-kubelet
- name: restart kubelet
service:
name: kubelet
state: restarted
- name: restart proxy
command: /bin/true
notify:
- reload systemd
- restart reloaded-proxy
- name: restart reloaded-proxy
service:
name: kube-proxy
state: restarted

12
roles/kubernetes/node/handlers/main.yml

@ -1,20 +1,14 @@
---
- name: restart daemons
command: /bin/true
notify:
- reload systemd
- restart reloaded-kubelet
- name: reload systemd
command: systemctl daemon-reload
- name: restart kubelet
- name: restart systemd-kubelet
command: /bin/true
notify:
- reload systemd
- restart reloaded-kubelet
- restart kubelet
- name: restart reloaded-kubelet
- name: restart kubelet
service:
name: kubelet
state: restarted

9
roles/kubernetes/node/tasks/install.yml

@ -1,18 +1,18 @@
---
- name: Write kubelet systemd init file
template: src=kubelet.service.j2 dest=/etc/systemd/system/kubelet.service backup=yes
notify: restart kubelet
when: init_system == "systemd"
notify: restart systemd-kubelet
- name: Write kubelet initd script
template: src=deb-kubelet.initd.j2 dest=/etc/init.d/kubelet owner=root mode=755 backup=yes
notify: restart reloaded-kubelet
when: init_system == "sysvinit" and ansible_os_family == "Debian"
notify: restart kubelet
- name: Write kubelet initd script
template: src=rh-kubelet.initd.j2 dest=/etc/init.d/kubelet owner=root mode=755 backup=yes
notify: restart reloaded-kubelet
when: init_system == "sysvinit" and ansible_os_family == "RedHat"
notify: restart kubelet
- name: Install kubelet binary
copy:
@ -33,5 +33,4 @@
dest=/usr/libexec/kubernetes/kubelet-plugins/net/exec/calico/calico
mode=0755
when: kube_network_plugin == "calico"
notify:
- restart kubelet
notify: restart kubelet

16
roles/network_plugin/handlers/main.yml

@ -1,6 +1,17 @@
---
- name : reload systemd
shell: systemctl daemon-reload
- name: restart systemd-calico-node
command: /bin/true
notify:
- reload systemd
- restart calico-node
- name: restart calico-node
service: name=calico-node state=restarted
service:
name: calico-node
state: restarted
- name: restart docker
service: name=docker state=restarted
@ -23,6 +34,3 @@
- name: start docker
service: name=docker state=started
- name : reload systemd
shell: systemctl daemon-reload
Loading…
Cancel
Save