2014-03-06 20:54:37 +08:00
|
|
|
---
|
2014-09-05 03:14:11 +08:00
|
|
|
- name: Copy RGW bootstrap key
|
2015-02-22 08:16:00 +08:00
|
|
|
copy: >
|
|
|
|
src=fetch/{{ fsid }}/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
|
|
|
|
dest=/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=600
|
2014-09-05 03:14:11 +08:00
|
|
|
when: cephx
|
|
|
|
|
|
|
|
- name: Set RGW bootstrap key permissions
|
2015-02-22 08:16:00 +08:00
|
|
|
file: >
|
|
|
|
path=/etc/ceph/radosgw.{{ ansible_hostname }}.keyring
|
|
|
|
mode=0600
|
|
|
|
owner=root
|
|
|
|
group=root
|
2014-09-05 03:14:11 +08:00
|
|
|
when: cephx
|
|
|
|
|
2015-03-02 17:22:52 +08:00
|
|
|
- name: Create RGW directory
|
|
|
|
file: >
|
|
|
|
path=/var/lib/ceph/radosgw/{{ ansible_fqdn }}
|
|
|
|
state=directory
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
mode=0644
|
|
|
|
|
2014-03-06 20:54:37 +08:00
|
|
|
## Check OS family
|
|
|
|
#
|
|
|
|
|
2014-11-06 00:57:28 +08:00
|
|
|
- include: install_redhat.yml
|
2015-03-02 17:22:52 +08:00
|
|
|
when: ansible_os_family == 'RedHat' and radosgw_frontend == 'apache'
|
2014-03-06 20:54:37 +08:00
|
|
|
|
2014-11-06 00:57:28 +08:00
|
|
|
- include: install_debian.yml
|
2015-03-02 17:22:52 +08:00
|
|
|
when: ansible_os_family == 'Debian' and radosgw_frontend == 'apache'
|
|
|
|
|
|
|
|
- name: "Install Rados Gateway"
|
|
|
|
apt: >
|
|
|
|
pkg=radosgw
|
|
|
|
state=present
|
|
|
|
update_cache=yes
|
2014-03-06 20:54:37 +08:00
|
|
|
when: ansible_os_family == 'Debian'
|
2015-03-02 17:22:52 +08:00
|
|
|
|
|
|
|
- name: "Install Rados Gateway"
|
|
|
|
yum: >
|
|
|
|
name=ceph-radosgw
|
|
|
|
state=present
|
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|
|
|
|
## 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
|
|
|
|
register: rgwstatus
|
|
|
|
ignore_errors: True
|
|
|
|
|
|
|
|
- name: Start RGW
|
|
|
|
command: /etc/init.d/radosgw start
|
|
|
|
when: rgwstatus.rc != 0
|