mirror of https://github.com/ceph/ceph-ansible.git
71 lines
2.2 KiB
YAML
71 lines
2.2 KiB
YAML
---
|
|
## Deploy RADOS Gateway
|
|
#
|
|
|
|
- name: Copy RGW bootstrap key
|
|
copy: src=fetch/{{ fsid }}/etc/ceph/keyring.radosgw.gateway dest=/etc/ceph/keyring.radosgw.gateway owner=root group=root mode=600
|
|
when: cephx
|
|
|
|
- name: Set RGW bootstrap key permissions
|
|
file: path=/etc/ceph/keyring.radosgw.gateway mode=0600 owner=root group=root
|
|
when: cephx
|
|
|
|
#- name: Add optimized version of the apache2 package repository
|
|
# apt_repository: repo='deb http://gitbuilder.ceph.com/apache2-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main' state=present
|
|
#
|
|
#- name: Add optimized version of the fastcgi package repository
|
|
# apt_repository: repo='deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main' state=present
|
|
#
|
|
|
|
- name: Add Ceph extra
|
|
apt_repository: repo='deb http://ceph.com/packages/ceph-extras/debian {{ ansible_lsb.codename }} main' state=present
|
|
|
|
- name: Install Apache, fastcgi and Rados Gateway
|
|
apt: pkg={{ item }} state=present
|
|
with_items:
|
|
- apache2
|
|
- libapache2-mod-fastcgi
|
|
- radosgw
|
|
|
|
## Prepare Apache
|
|
#
|
|
|
|
- name: Install default httpd.conf
|
|
template: src=httpd.conf dest=/etc/apache2/httpd.conf owner=root group=root
|
|
|
|
- name: Enable some apache mod rewrite and fastcgi
|
|
command: "{{ item }}"
|
|
with_items:
|
|
- a2enmod rewrite
|
|
- a2enmod fastcgi
|
|
|
|
- name: Install Rados Gateway vhost
|
|
template: src=rgw.conf dest=/etc/apache2/sites-available/rgw.conf owner=root group=root
|
|
|
|
## Prepare RGW
|
|
#
|
|
|
|
- name: Create RGW directory
|
|
file: path=/var/lib/ceph/radosgw/{{ ansible_fqdn }} state=directory owner=root group=root mode=0644
|
|
|
|
- name: Enable Rados Gateway vhost and disable default site
|
|
command: "{{ item }}"
|
|
with_items:
|
|
- a2ensite rgw.conf
|
|
- a2dissite default
|
|
notify:
|
|
- restart apache2
|
|
|
|
- name: Install s3gw.fcgi script
|
|
copy: src=s3gw.fcgi dest=/var/www/s3gw.fcgi mode=0555 owner=root group=root
|
|
|
|
## 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
|