Add support of civetweb for Rados Gateway

Almost here.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
pull/218/head
Sébastien Han 2015-03-02 10:22:52 +01:00
parent 4990a9abdb
commit c5c0e21532
6 changed files with 42 additions and 42 deletions

View File

@ -120,10 +120,12 @@ osd_recovery_threads: 1
# #
mds: false # disable mds configuration in ceph.conf mds: false # disable mds configuration in ceph.conf
# Rados Gateway options ## Rados Gateway options
# #
radosgw: false # referenced in monitor role too. radosgw: false # referenced in monitor role too.
#radosgw_dns_name: your.subdomain.tld # subdomains used by radosgw. See http://ceph.com/docs/master/radosgw/config/#enabling-subdomain-s3-calls #radosgw_dns_name: your.subdomain.tld # subdomains used by radosgw. See http://ceph.com/docs/master/radosgw/config/#enabling-subdomain-s3-calls
radosgw_frontend: civetweb # supported options are 'apache' or 'civetweb', also edit roles/ceph-radosgw/defaults/main.yml
radosgw_civetweb_port: 80
## Testing mode ## Testing mode
# enable this mode _only_ when you have a single node # enable this mode _only_ when you have a single node

View File

@ -145,6 +145,9 @@
log file = /var/log/ceph/radosgw-{{ hostvars[host]['ansible_hostname'] }}.log log file = /var/log/ceph/radosgw-{{ hostvars[host]['ansible_hostname'] }}.log
rgw data = /var/lib/ceph/radosgw/{{ hostvars[host]['ansible_hostname'] }} rgw data = /var/lib/ceph/radosgw/{{ hostvars[host]['ansible_hostname'] }}
rgw print continue = false rgw print continue = false
{% if radosgw_frontend == 'civetweb' %}
rgw frontends = civetweb port={{ radosgw_civetweb_port }}
{% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}

View File

@ -12,3 +12,5 @@ http_100_continue: false
# Rados Gateway options # Rados Gateway options
redhat_distro_ceph_extra: centos6.4 # supported distros are centos6.3, centos6.4, centos6, fedora18, fedora19, opensuse12.2, rhel6.3, rhel6.4, rhel6.5, rhel6, sles11sp2 redhat_distro_ceph_extra: centos6.4 # supported distros are centos6.3, centos6.4, centos6, fedora18, fedora19, opensuse12.2, rhel6.3, rhel6.4, rhel6.5, rhel6, sles11sp2
email_address: foo@bar.com email_address: foo@bar.com
radosgw_frontend: civetweb # we currently only support a single backend

View File

@ -86,7 +86,7 @@
- libapache2-mod-fastcgi - libapache2-mod-fastcgi
when: purge_default_apache.changed or purge_ceph_apache.changed when: purge_default_apache.changed or purge_ceph_apache.changed
- name: "Install Apache, fastcgi and Rados Gateway" - name: "Install Apache and fastcgi"
apt: > apt: >
pkg={{ item }} pkg={{ item }}
state=present state=present
@ -94,7 +94,6 @@
with_items: with_items:
- apache2 - apache2
- libapache2-mod-fastcgi - libapache2-mod-fastcgi
- radosgw
## Prepare Apache ## Prepare Apache
# #
@ -118,14 +117,6 @@
## Prepare RGW ## 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 - name: Enable Rados Gateway vhost and disable default site
command: "{{ item }}" command: "{{ item }}"
with_items: with_items:
@ -142,13 +133,3 @@
mode=0555 mode=0555
owner=root owner=root
group=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

View File

@ -15,7 +15,7 @@
- name: Add special fastcgi repository - name: Add special fastcgi repository
command: rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm command: rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
- name: "Install Apache, fastcgi, and Rados Gateway" - name: "Install Apache and fastcgi"
yum: > yum: >
name={{ item }} name={{ item }}
state=present state=present
@ -23,7 +23,6 @@
- httpd - httpd
- mod_fastcgi - mod_fastcgi
- mod_fcgid - mod_fcgid
- ceph-radosgw
## Prepare Apache ## Prepare Apache
# #
@ -38,14 +37,6 @@
## Prepare RGW ## Prepare RGW
# #
- name: Create RGW directory
file: >
path=/var/lib/ceph/radosgw/{{ ansible_fqdn }}
state=directory
owner=root
group=root
mode=0644
- name: Install s3gw.fcgi script - name: Install s3gw.fcgi script
template: > template: >
src=s3gw.fcgi.j2 src=s3gw.fcgi.j2
@ -59,13 +50,3 @@
changed_when: False changed_when: False
notify: notify:
- restart apache2 - restart apache2
## If we don't perform this check Ansible will start multiple instance of radosgw
- name: Check if RGW is started
command: /etc/init.d/ceph-radosgw status
register: rgwstatus
ignore_errors: True
- name: Start RGW
command: /etc/init.d/ceph-radosgw start
when: rgwstatus.rc != 0

View File

@ -16,11 +16,42 @@
group=root group=root
when: cephx when: cephx
- name: Create RGW directory
file: >
path=/var/lib/ceph/radosgw/{{ ansible_fqdn }}
state=directory
owner=root
group=root
mode=0644
## Check OS family ## Check OS family
# #
- include: install_redhat.yml - include: install_redhat.yml
when: ansible_os_family == 'RedHat' when: ansible_os_family == 'RedHat' and radosgw_frontend == 'apache'
- include: install_debian.yml - include: install_debian.yml
when: ansible_os_family == 'Debian' and radosgw_frontend == 'apache'
- name: "Install Rados Gateway"
apt: >
pkg=radosgw
state=present
update_cache=yes
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian'
- 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