2016-04-27 21:17:56 +08:00
|
|
|
---
|
|
|
|
- name: get ceph version
|
|
|
|
command: ceph --version
|
|
|
|
changed_when: false
|
|
|
|
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
|
|
|
|
register: init_system
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
init_system={{ init_system.content | b64decode }}
|
|
|
|
|
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-04-27 21:17:56 +08:00
|
|
|
# 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...
|
2016-04-27 21:28:17 +08:00
|
|
|
# is_before facts
|
|
|
|
- set_fact:
|
|
|
|
is_before_hammer={{ ceph_version | version_compare('0.94.0', '<') }}
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_before_infernalis={{ ceph_version | version_compare('9.0.0', '<') }}
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_before_jewel={{ ceph_version | version_compare('10.0.0', '<') }}
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_before_kraken={{ ceph_version | version_compare('11.0.0', '<') }}
|
|
|
|
|
|
|
|
# is_after facts
|
2016-04-27 21:17:56 +08:00
|
|
|
- set_fact:
|
|
|
|
is_after_hammer={{ ceph_version | version_compare('0.95.0', '>') }}
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_after_infernalis={{ ceph_version | version_compare('9.4.0', '>') }}
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_after_jewel={{ ceph_version | version_compare('10.4.0', '>') }}
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_after_kraken={{ ceph_version | version_compare('11.4.0', '>') }}
|
|
|
|
|
2016-04-27 21:28:17 +08:00
|
|
|
# is_version facts
|
2016-04-27 21:17:56 +08:00
|
|
|
- set_fact:
|
|
|
|
is_hammer={{ ceph_version | version_compare('0.94.0', '>=') | version_compare('9.0.0', '<') }}
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_infernalis={{ ceph_version | version_compare('9.0.0', '>=') and ceph_version | version_compare('10.0.0', '<') }}
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_jewel={{ ceph_version | version_compare('10.0.0', '>=') and ceph_version | version_compare('11.0.0', '<') }}
|
|
|
|
|
|
|
|
- set_fact:
|
|
|
|
is_kraken={{ ceph_version | version_compare('11.0.0', '>=') and ceph_version | version_compare('12.0.0', '<') }}
|
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
|
|
|
|
|