mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-05-07 09:27:38 -02:30
use ansible_service_mgr to detect init system
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
src: "kube-apiserver.service.j2"
|
||||
dest: "/etc/systemd/system/kube-apiserver.service"
|
||||
backup: yes
|
||||
when: init_system == "systemd"
|
||||
when: ansible_service_mgr == "systemd"
|
||||
notify: restart kube-apiserver
|
||||
|
||||
- name: install | Write kube-apiserver initd script
|
||||
@@ -28,7 +28,7 @@
|
||||
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"
|
||||
|
||||
- name: Write kube-apiserver config file
|
||||
template:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
- name: reload systemd
|
||||
command: systemctl daemon-reload
|
||||
when: init_system == "systemd" and restart_apimaster is defined and restart_apimaster == True
|
||||
when: ansible_service_mgr == "systemd" and restart_apimaster is defined and restart_apimaster == True
|
||||
|
||||
- name: reload kube-apiserver
|
||||
service:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# The following values are used to configure the kube-apiserver
|
||||
|
||||
{% if init_system == "sysvinit" %}
|
||||
{% if ansible_service_mgr in ["sysvinit","upstart"] %}
|
||||
# Logging directory
|
||||
KUBE_LOGGING="--log-dir={{ kube_log_dir }} --logtostderr=true"
|
||||
{% else %}
|
||||
@@ -38,7 +38,7 @@ KUBE_TLS_CONFIG="--tls_cert_file={{ kube_cert_dir }}/apiserver.pem --tls_private
|
||||
# Add you own!
|
||||
KUBE_API_ARGS="--token_auth_file={{ kube_token_dir }}/known_tokens.csv --basic-auth-file={{ kube_users_dir }}/known_users.csv --service_account_key_file={{ kube_cert_dir }}/apiserver-key.pem"
|
||||
|
||||
{% if init_system == "sysvinit" %}
|
||||
{% if ansible_service_mgr in ["sysvinit","upstart"] %}
|
||||
DAEMON_ARGS="$KUBE_LOGGING $KUBE_LOG_LEVEL $KUBE_ALLOW_PRIV $KUBE_API_PORT $KUBE_SERVICE_ADDRESSES \
|
||||
$KUBE_ETCD_SERVERS $KUBE_ADMISSION_CONTROL $KUBE_RUNTIME_CONFIG $KUBE_TLS_CONFIG $KUBE_API_ARGS"
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user