ceph-ansible/roles/ceph-rgw/tasks/start_radosgw.yml

49 lines
1.3 KiB
YAML

---
- name: check if rgw is started
command: /etc/init.d/radosgw status
register: rgwstatus
changed_when: false
failed_when: false
- name: start rgw
command: /etc/init.d/radosgw start
when:
rgwstatus.rc != 0 and
ansible_distribution != "Ubuntu" and
ansible_os_family != 'RedHat'
- name: start and add that the rados gateway service to the init sequence (ubuntu)
command: initctl emit radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }}
changed_when: false
failed_when: false
when: ansible_distribution == 'Ubuntu'
- name: start rgw on red hat (before or on infernalis)
service:
name: ceph-radosgw
state: started
enabled: yes
when:
ansible_os_family == 'RedHat' and
not is_ceph_infernalis
- name: enable systemd unit file for rgw instance (for or after infernalis)
file:
src: /usr/lib/systemd/system/ceph-radosgw@.service
dest: /etc/systemd/system/multi-user.target.wants/ceph-radosgw@rgw.{{ ansible_hostname }}.service
state: link
changed_when: false
failed_when: false
when:
ansible_distribution != "Ubuntu" and
is_ceph_infernalis
- name: start rgw on red hat (after infernalis)
service:
name: ceph-radosgw@rgw.{{ ansible_hostname }}
state: started
enabled: yes
when:
ansible_os_family == 'RedHat' and
is_ceph_infernalis