2016-04-27 21:17:56 +08:00
|
|
|
---
|
|
|
|
- name: get ceph version
|
|
|
|
command: ceph --version
|
|
|
|
changed_when: false
|
2016-07-19 20:52:45 +08:00
|
|
|
always_run: true
|
2016-04-27 21:17:56 +08:00
|
|
|
register: ceph_version
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
ceph_version: "{{ ceph_version.stdout.split(' ')[2] }}"
|
|
|
|
|
2016-05-04 18:47:24 +08:00
|
|
|
# NOTE(mattt): On ansible 2.x we can use ansible_service_mgr instead
|
|
|
|
- name: check init system
|
|
|
|
slurp:
|
|
|
|
src: /proc/1/comm
|
2016-07-19 20:52:45 +08:00
|
|
|
always_run: true
|
2016-05-04 18:47:24 +08:00
|
|
|
register: init_system
|
|
|
|
|
|
|
|
- set_fact:
|
2016-06-29 05:54:34 +08:00
|
|
|
init_system={{ init_system.content | b64decode | trim }}
|
2016-05-04 18:47:24 +08:00
|
|
|
|
2016-05-05 01:16:27 +08:00
|
|
|
- set_fact:
|
2016-05-06 22:14:06 +08:00
|
|
|
use_systemd={{ init_system.strip() == 'systemd' }}
|
2016-05-05 01:16:27 +08:00
|
|
|
|
2016-05-09 06:36:15 +08:00
|
|
|
- set_fact:
|
|
|
|
mds_name: "{{ ansible_hostname }}"
|
|
|
|
when: not mds_use_fqdn
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
mds_name: "{{ ansible_fqdn }}"
|
|
|
|
when: mds_use_fqdn
|