mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-17 17:07:36 -02:30
use ansible_service_mgr to detect init system
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
- name: reload systemd
|
||||
command: systemctl daemon-reload
|
||||
when: init_system == "systemd"
|
||||
when: ansible_service_mgr == "systemd"
|
||||
|
||||
- name: reload etcd
|
||||
service:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
src: etcd.service.j2
|
||||
dest: /lib/systemd/system/etcd.service
|
||||
backup: yes
|
||||
when: init_system == "systemd"
|
||||
when: ansible_service_mgr == "systemd"
|
||||
notify: restart etcd
|
||||
|
||||
- name: Configure | Write etcd initd script
|
||||
@@ -13,7 +13,7 @@
|
||||
dest: /etc/init.d/etcd
|
||||
owner: root
|
||||
mode: 0755
|
||||
when: init_system == "sysvinit" and ansible_os_family == "Debian"
|
||||
when: ansible_service_mgr in ["sysvinit","upstart"] and ansible_os_family == "Debian"
|
||||
notify: restart etcd
|
||||
|
||||
- name: Configure | Create etcd config file
|
||||
|
||||
Reference in New Issue
Block a user