mirror of https://github.com/ceph/ceph-ansible.git
144 lines
4.4 KiB
YAML
144 lines
4.4 KiB
YAML
---
|
|
## Deploy RADOS Gateway
|
|
#
|
|
|
|
- name: Add Ceph extra
|
|
apt_repository: >
|
|
repo="deb http://ceph.com/packages/ceph-extras/debian {{ ansible_lsb.codename }} main"
|
|
state=present
|
|
when: ansible_lsb.codename in ['natty', 'oneiric', 'precise', 'quantal', 'raring', 'sid', 'squeeze', 'wheezy']
|
|
|
|
# Needed for Ubuntu 12.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used
|
|
- name: Enable multiverse repo for Precise
|
|
apt_repository: >
|
|
repo="{{ item }}"
|
|
state=present
|
|
with_items:
|
|
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }} multiverse
|
|
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse
|
|
- deb http://security.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-security multiverse
|
|
when: ansible_lsb.codename in ['precise'] and not http_100_continue
|
|
|
|
# Disable the repo when we are using the Ceph repo for 100-continue packages
|
|
- name: Disable multiverse repo for Precise
|
|
apt_repository: >
|
|
repo="{{ item }}"
|
|
state=absent
|
|
with_items:
|
|
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }} multiverse
|
|
- deb http://archive.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-updates multiverse
|
|
- deb http://security.ubuntu.com/ubuntu {{ ansible_lsb.codename }}-security multiverse
|
|
when: ansible_lsb.codename in ['precise'] and http_100_continue
|
|
|
|
# Needed for Ubuntu 14.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used
|
|
- name: Enable multiverse repo for Trusty
|
|
command: "apt-add-repository multiverse"
|
|
when: ansible_lsb.codename in ['trusty'] and not http_100_continue
|
|
changed_when: False
|
|
|
|
# Disable the repo when we are using the Ceph repo for 100-continue packages
|
|
- name: Disable multiverse repo for Trusty
|
|
command: "apt-add-repository -r multiverse"
|
|
when: ansible_lsb.codename in ['trusty'] and http_100_continue
|
|
changed_when: False
|
|
|
|
# If using 100-continue, add Ceph dev key
|
|
- name: Install the Ceph development repository key
|
|
apt_key: >
|
|
data="{{ lookup('file', 'cephdev.asc') }}"
|
|
state=present
|
|
when: http_100_continue
|
|
|
|
# If using 100-continue, add Ceph sources and update
|
|
- name: Add Ceph Apache and FastCGI sources
|
|
apt_repository: >
|
|
repo="{{ item }}"
|
|
state=present
|
|
with_items:
|
|
- deb http://gitbuilder.ceph.com/apache2-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main
|
|
- deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main
|
|
register: purge_default_apache
|
|
when: http_100_continue
|
|
|
|
# Else remove them to ensure you use the default packages
|
|
- name: Remove Ceph Apache and FastCGI sources
|
|
apt_repository: >
|
|
repo="{{ item }}"
|
|
state=absent
|
|
with_items:
|
|
- deb http://gitbuilder.ceph.com/apache2-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main
|
|
- deb http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-{{ ansible_lsb.codename }}-x86_64-basic/ref/master {{ ansible_lsb.codename }} main
|
|
register: purge_ceph_apache
|
|
when: not http_100_continue
|
|
|
|
# Purge Ceph Apache and FastCGI packages if needed
|
|
- name: "Purge Ceph Apache and FastCGI packages"
|
|
apt: >
|
|
pkg="{{ item }}"
|
|
state=absent
|
|
purge=yes
|
|
with_items:
|
|
- apache2
|
|
- apache2-bin
|
|
- apache2-data
|
|
- apache2-mpm-worker
|
|
- apache2-utils
|
|
- apache2.2-bin
|
|
- apache2.2-common
|
|
- libapache2-mod-fastcgi
|
|
when: purge_default_apache.changed or purge_ceph_apache.changed
|
|
|
|
- name: "Install Apache and fastcgi"
|
|
apt: >
|
|
pkg={{ item }}
|
|
state=present
|
|
update_cache=yes
|
|
with_items:
|
|
- apache2
|
|
- libapache2-mod-fastcgi
|
|
|
|
## 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
|
|
changed_when: False
|
|
|
|
- name: Install Rados Gateway vhost
|
|
template: >
|
|
src=rgw.conf
|
|
dest=/etc/apache2/sites-available/rgw.conf
|
|
owner=root
|
|
group=root
|
|
|
|
## Prepare RGW
|
|
#
|
|
|
|
- name: Enable Rados Gateway vhost and disable default site
|
|
command: "{{ item }}"
|
|
with_items:
|
|
- a2ensite rgw.conf
|
|
- a2dissite *default
|
|
ignore_errors: True
|
|
notify:
|
|
- restart apache2
|
|
changed_when: False
|
|
|
|
- name: Install s3gw.fcgi script
|
|
template: >
|
|
src=s3gw.fcgi.j2
|
|
dest=/var/www/s3gw.fcgi
|
|
mode=0555
|
|
owner=root
|
|
group=root
|