mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-22 05:30:51 -03:30
use ansible_service_mgr to detect init system
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: reload systemd
|
||||
command: systemctl daemon-reload
|
||||
when: init_system == "systemd"
|
||||
when: ansible_service_mgr == "systemd"
|
||||
|
||||
- name: restart kubelet
|
||||
command: /bin/true
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
---
|
||||
- name: install | Write kubelet systemd init file
|
||||
template: src=kubelet.service.j2 dest=/etc/systemd/system/kubelet.service backup=yes
|
||||
when: init_system == "systemd"
|
||||
when: ansible_service_mgr == "systemd"
|
||||
notify: restart kubelet
|
||||
|
||||
- name: install | Write kubelet initd script
|
||||
template: src=deb-kubelet.initd.j2 dest=/etc/init.d/kubelet owner=root mode=0755 backup=yes
|
||||
when: init_system == "sysvinit" and ansible_os_family == "Debian"
|
||||
when: ansible_service_mgr in ["sysvinit","upstart"] and ansible_os_family == "Debian"
|
||||
notify: restart kubelet
|
||||
|
||||
- name: install | Write kubelet initd script
|
||||
template: src=rh-kubelet.initd.j2 dest=/etc/init.d/kubelet owner=root mode=0755 backup=yes
|
||||
when: init_system == "sysvinit" and ansible_os_family == "RedHat"
|
||||
when: ansible_service_mgr in ["sysvinit","upstart"] and ansible_os_family == "RedHat"
|
||||
notify: restart kubelet
|
||||
|
||||
- name: install | Install kubelet binary
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% if init_system == "sysvinit" %}
|
||||
{% if ansible_service_mgr in ["sysvinit","upstart"] %}
|
||||
# Logging directory
|
||||
KUBE_LOGGING="--log-dir={{ kube_log_dir }} --logtostderr=true"
|
||||
{% else %}
|
||||
@@ -30,7 +30,7 @@ DOCKER_SOCKET="--docker-endpoint=unix:/var/run/weave/weave.sock"
|
||||
{% endif %}
|
||||
# Should this cluster be allowed to run privileged docker containers
|
||||
KUBE_ALLOW_PRIV="--allow_privileged=true"
|
||||
{% if init_system == "sysvinit" %}
|
||||
{% if ansible_service_mgr in ["sysvinit","upstart"] %}
|
||||
DAEMON_ARGS="$KUBE_LOGGING $KUBE_LOG_LEVEL $KUBE_ALLOW_PRIV $KUBELET_API_SERVER $KUBELET_ADDRESS \
|
||||
$KUBELET_HOSTNAME $KUBELET_REGISTER_NODE $KUBELET_ARGS $DOCKER_SOCKET $KUBELET_ARGS $KUBELET_NETWORK_PLUGIN"
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user