mirror of https://github.com/ceph/ceph-ansible.git
79 lines
2.3 KiB
YAML
79 lines
2.3 KiB
YAML
---
|
|
- 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
|
|
file:
|
|
path: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/{{ item }}
|
|
state: touch
|
|
owner: root
|
|
group: root
|
|
mode: 0600
|
|
with_items:
|
|
- done
|
|
- upstart
|
|
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')
|
|
changed_when: false
|
|
|
|
- name: start and add that the monitor service to the init sequence (ubuntu)
|
|
service:
|
|
name: ceph-mon
|
|
state: started
|
|
enabled: yes
|
|
args: "id={{ ansible_hostname }}"
|
|
when: ansible_distribution == "Ubuntu"
|
|
|
|
# NOTE (leseb): somehow the service ansible module is messing things up
|
|
# as a safety measure we run the raw command
|
|
- name: start and add that the monitor service to the init sequence
|
|
command: service ceph start mon
|
|
changed_when: false
|
|
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')
|
|
|
|
- name: start and add that the monitor service to the init sequence (for or after infernalis)
|
|
service:
|
|
name: ceph-mon@{{ ansible_hostname }}
|
|
state: started
|
|
enabled: yes
|
|
changed_when: false
|
|
when:
|
|
ansible_distribution != "Ubuntu" and not
|
|
(ceph_stable_release == 'dumpling' or
|
|
ceph_stable_release == 'emperor' or
|
|
ceph_stable_release == 'firefly' or
|
|
ceph_stable_release == 'giant' or
|
|
ceph_stable_release == 'hammer')
|
|
|
|
- name: collect admin and bootstrap keys
|
|
command: ceph-create-keys --id {{ ansible_hostname }}
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: get ceph monitor version
|
|
shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
|
|
changed_when: false
|
|
failed_when: "'No such file or directory' in ceph_version.stderr"
|
|
register: ceph_version
|