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

55 lines
1.4 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: activate rgw on ubuntu
command: initctl emit radosgw cluster=ceph id=rgw.{{ ansible_hostname }}
changed_when: false
when: ansible_distribution == 'Ubuntu'
- name: start rgw on ubuntu
service:
name: radosgw
args: id=rgw.{{ ansible_hostname }}
state: started
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