use ansible_service_mgr to detect init system

This commit is contained in:
Smana
2016-02-13 11:17:20 +01:00
parent 7fef64dacd
commit a649aa8b7e
17 changed files with 30 additions and 48 deletions

View File

@@ -15,24 +15,6 @@
paths:
- ../vars
- name: "Identify init system"
shell: >
$(pgrep systemd > /dev/null && systemctl status network.target > /dev/null);
if [ $? -eq 0 ] ; then
echo systemd;
else
echo sysvinit;
fi
always_run: True
register: init_system_output
changed_when: False
tags: always
- set_fact:
init_system: "{{ init_system_output.stdout }}"
always_run: True
tags: always
- name: Create kubernetes config directory
file:
path: "{{ kube_config_dir }}"
@@ -56,7 +38,7 @@
path: "{{ kube_log_dir }}"
state: directory
owner: kube
when: init_system == "sysvinit"
when: ansible_service_mgr in ["sysvinit","upstart"]
- name: Create cni directories
file: