when: ansible_distribution == "Ubuntu"
changed_when: false
-- 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
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
- service: >
- name=ceph
- state=started
- enabled=yes
- args=mon
+ command: service ceph start mon
when: ansible_distribution != "Ubuntu"
+- name: collect admin and bootstrap keys
+ command: ceph-create-keys --id {{ ansible_hostname }}
+ changed_when: false
+ failed_when: false
+ when: ansible_os_family == 'RedHat'
+
- name: get Ceph monitor version
shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
changed_when: false
---
-# NOTE (leseb): if we don't perform this check Ansible will start multiple instance of radosgw
- name: check if RGW is started
command: /etc/init.d/radosgw status
- changed_when: false
- ignore_errors: true
register: rgwstatus
+ ignore_errors: true
- name: start RGW
command: /etc/init.d/radosgw start
ansible_os_family != 'RedHat'
- name: start RGW
- service: >
- name=radosgw-all
- state=started
+ service: name=radosgw-all state=started
when: ansible_distribution == "Ubuntu"
- name: start RGW
- service: >
- name=ceph-radosgw
- state=started
+ service: name=ceph-radosgw state=started
when: ansible_os_family == 'RedHat'