mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-28 09:39:12 +03:00
use ansible_service_mgr to detect init system
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
- name : reload systemd
|
||||
shell: systemctl daemon-reload
|
||||
when: init_system == "systemd"
|
||||
when: ansible_service_mgr == "systemd"
|
||||
|
||||
- name: reload docker
|
||||
service:
|
||||
|
||||
@@ -47,6 +47,6 @@
|
||||
src: systemd-docker.service
|
||||
dest: /lib/systemd/system/docker.service
|
||||
notify: restart docker
|
||||
when: init_system == "systemd"
|
||||
when: ansible_service_mgr == "systemd"
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Deployed by Ansible
|
||||
{% if init_system == "sysvinit" and kube_network_plugin == "flannel" and ansible_os_family == "Debian" %}
|
||||
{% if ansible_service_mgr in ["sysvinit","upstart"] and kube_network_plugin == "flannel" and ansible_os_family == "Debian" %}
|
||||
DOCKER_OPTS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}"
|
||||
{% elif kube_network_plugin == "flannel" %}
|
||||
OPTIONS="--bip={{ flannel_subnet }} --mtu={{ flannel_mtu }}"
|
||||
|
||||
Reference in New Issue
Block a user