2015-03-26 22:43:54 +08:00
|
|
|
---
|
2015-11-17 23:10:02 +08:00
|
|
|
- name: activate monitor with upstart for or after infernalis release
|
|
|
|
file:
|
|
|
|
path: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/{{ item }}
|
|
|
|
state: touch
|
|
|
|
owner: ceph
|
|
|
|
group: ceph
|
|
|
|
mode: 0600
|
|
|
|
with_items:
|
|
|
|
- done
|
|
|
|
- upstart
|
|
|
|
when: ansible_distribution == "Ubuntu"
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
- name: activate monitor with upstart before infernalis release
|
2015-10-17 07:55:31 +08:00
|
|
|
file:
|
|
|
|
path: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/{{ item }}
|
|
|
|
state: touch
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
2015-03-26 22:43:54 +08:00
|
|
|
with_items:
|
|
|
|
- done
|
|
|
|
- upstart
|
2015-11-17 23:10:02 +08:00
|
|
|
when:
|
|
|
|
ansible_distribution == "Ubuntu" and
|
|
|
|
(ceph_stable_release == 'dumpling' or
|
|
|
|
ceph_stable_release == 'emperor' or
|
|
|
|
ceph_stable_release == 'firefly' or
|
|
|
|
ceph_stable_release == 'giant' or
|
|
|
|
ceph_stable_release == 'hammer')
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-03-26 22:43:54 +08:00
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: start and add that the monitor service to the init sequence (ubuntu)
|
2015-10-17 07:55:31 +08:00
|
|
|
service:
|
|
|
|
name: ceph-mon
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
args: "id={{ ansible_hostname }}"
|
2015-03-26 22:43:54 +08:00
|
|
|
when: ansible_distribution == "Ubuntu"
|
|
|
|
|
2015-07-01 00:43:43 +08:00
|
|
|
# NOTE (leseb): somehow the service ansible module is messing things up
|
|
|
|
# as a safety measure we run the raw command
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: start and add that the monitor service to the init sequence
|
2015-07-01 00:43:43 +08:00
|
|
|
command: service ceph start mon
|
2015-07-04 02:18:41 +08:00
|
|
|
changed_when: false
|
2015-03-26 22:43:54 +08:00
|
|
|
when: ansible_distribution != "Ubuntu"
|
|
|
|
|
2015-07-01 00:43:43 +08:00
|
|
|
- name: collect admin and bootstrap keys
|
|
|
|
command: ceph-create-keys --id {{ ansible_hostname }}
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
|
2015-07-24 02:01:43 +08:00
|
|
|
- name: get ceph monitor version
|
2015-03-26 22:43:54 +08:00
|
|
|
shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2015-07-24 18:36:45 +08:00
|
|
|
failed_when: "'No such file or directory' in ceph_version.stderr"
|
2015-03-26 22:43:54 +08:00
|
|
|
register: ceph_version
|