Merge pull request #236 from leseb/fix-mon-upstart

Activate either sysvinit or upstart
pull/239/head
Leseb 2015-03-26 18:50:43 +01:00
commit 421c14fb37
3 changed files with 47 additions and 11 deletions

View File

@ -23,14 +23,3 @@
command: > command: >
ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring creates=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring
- name: Start and add that the monitor service to the init sequence
service: >
name=ceph
state=started
enabled=yes
args=mon
- name: Get Ceph monitor version
shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
register: ceph_version

View File

@ -2,6 +2,9 @@
- include: deploy_monitors.yml - include: deploy_monitors.yml
when: not ceph_containerized_deployment when: not ceph_containerized_deployment
- include: start_monitor.yml
when: not ceph_containerized_deployment
- include: ceph_keys.yml - include: ceph_keys.yml
when: not ceph_containerized_deployment when: not ceph_containerized_deployment

View File

@ -0,0 +1,44 @@
---
- name: Activate monitor with upstart
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"
- name: Activate monitor with sysvinit
file: >
path=/var/lib/ceph/mon/ceph-{{ ansible_hostname }}/{{ item }}
state=touch
owner=root
group=root
mode=0600
with_items:
- done
- sysvinit
when: ansible_distribution != "Ubuntu"
- 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"
- name: Start and add that the monitor service to the init sequence
service: >
name=ceph
state=started
enabled=yes
args=mon
when: ansible_distribution != "Ubuntu"
- name: Get Ceph monitor version
shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
register: ceph_version