mirror of https://github.com/ceph/ceph-ansible.git
Merge pull request #755 from mattt416/fix_issue_741
Set init_system fact and reference in ceph-osd rolepull/757/head
commit
480cb68892
|
@ -8,6 +8,15 @@
|
|||
- set_fact:
|
||||
ceph_version: "{{ ceph_version.stdout.split(' ')[2] }}"
|
||||
|
||||
# NOTE(mattt): On ansible 2.x we can use ansible_service_mgr instead
|
||||
- name: check init system
|
||||
slurp:
|
||||
src: /proc/1/comm
|
||||
register: init_system
|
||||
|
||||
- set_fact:
|
||||
init_system={{ init_system.content | b64decode }}
|
||||
|
||||
# NOTE (leseb/jsaintrocc): You are supposed to quote variables
|
||||
# that follow colons to avoid confusion with dicts but this
|
||||
# causes issues with the boolean, so we keep this syntax styling...
|
||||
|
|
|
@ -31,11 +31,11 @@
|
|||
name: ceph
|
||||
state: started
|
||||
enabled: yes
|
||||
when: ansible_service_mgr != "systemd"
|
||||
when: init_system != "systemd"
|
||||
|
||||
- name: start and add the OSD target to the systemd sequence
|
||||
service:
|
||||
name: ceph.target
|
||||
state: started
|
||||
enabled: yes
|
||||
when: ansible_service_mgr == "systemd"
|
||||
when: init_system == "systemd"
|
||||
|
|
Loading…
Reference in New Issue