Merge pull request #755 from mattt416/fix_issue_741

Set init_system fact and reference in ceph-osd role
pull/757/head
Leseb 2016-05-04 16:39:41 +02:00
commit 480cb68892
2 changed files with 11 additions and 2 deletions

View File

@ -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...

View File

@ -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"