2014-09-05 03:14:11 +08:00
|
|
|
---
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: add ceph extra
|
2014-09-05 03:14:11 +08:00
|
|
|
apt_repository: >
|
|
|
|
repo="deb http://ceph.com/packages/ceph-extras/debian {{ ansible_lsb.codename }} main"
|
|
|
|
state=present
|
2014-11-11 17:07:41 +08:00
|
|
|
when: ansible_lsb.codename in ['natty', 'oneiric', 'precise', 'quantal', 'raring', 'sid', 'squeeze', 'wheezy']
|
2014-09-05 03:14:11 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): needed for Ubuntu 12.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: enable multiverse repo for precise
|
2014-11-17 18:11:48 +08:00
|
|
|
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
|
2015-06-26 06:26:03 +08:00
|
|
|
when:
|
|
|
|
ansible_lsb.codename in ['precise'] and not
|
|
|
|
http_100_continue
|
2014-11-14 22:05:56 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: disable multiverse repo for precise
|
2014-11-17 18:11:48 +08:00
|
|
|
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
|
2015-06-26 06:26:03 +08:00
|
|
|
when:
|
|
|
|
ansible_lsb.codename in ['precise'] and
|
|
|
|
http_100_continue
|
2014-11-14 22:05:56 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): needed for Ubuntu 14.04 to have access to libapache2-mod-fastcgi if 100-continue isn't being used
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: enable multiverse repo for trusty
|
2014-11-11 17:07:41 +08:00
|
|
|
command: "apt-add-repository multiverse"
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
ansible_lsb.codename in ['trusty'] and not
|
|
|
|
http_100_continue
|
2014-11-14 22:05:56 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: disable multiverse repo for trusty
|
2014-11-14 22:05:56 +08:00
|
|
|
command: "apt-add-repository -r multiverse"
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
ansible_lsb.codename in ['trusty'] and
|
|
|
|
http_100_continue
|
2014-11-14 22:05:56 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): if using 100-continue, add Ceph dev key
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: install the ceph development repository key
|
2014-11-14 22:05:56 +08:00
|
|
|
apt_key: >
|
|
|
|
data="{{ lookup('file', 'cephdev.asc') }}"
|
|
|
|
state=present
|
|
|
|
when: http_100_continue
|
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): if using 100-continue, add Ceph sources and update
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: add ceph apache and fastcgi sources
|
2014-11-14 22:05:56 +08:00
|
|
|
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
|
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): else remove them to ensure you use the default packages
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: remove ceph apache and fastcgi sources
|
2014-11-14 22:05:56 +08:00
|
|
|
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
|
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
# NOTE (leseb): purge Ceph Apache and FastCGI packages if needed
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: purge ceph apache and fastcgi packages
|
2014-11-14 22:05:56 +08:00
|
|
|
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
|
2015-06-26 06:26:03 +08:00
|
|
|
when:
|
|
|
|
purge_default_apache.changed or
|
|
|
|
purge_ceph_apache.changed
|
2014-11-11 17:07:41 +08:00
|
|
|
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: install apache and fastcgi
|
2014-09-05 03:14:11 +08:00
|
|
|
apt: >
|
|
|
|
pkg={{ item }}
|
|
|
|
state=present
|
2014-11-11 17:07:41 +08:00
|
|
|
update_cache=yes
|
2014-09-05 03:14:11 +08:00
|
|
|
with_items:
|
|
|
|
- apache2
|
|
|
|
- libapache2-mod-fastcgi
|
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: install default httpd.conf
|
2015-03-19 19:21:29 +08:00
|
|
|
template: >
|
|
|
|
src=httpd.conf
|
|
|
|
dest=/etc/apache2/httpd.conf
|
|
|
|
owner=root
|
|
|
|
group=root
|
2014-09-05 03:14:11 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: enable some apache mod rewrite and fastcgi
|
2014-09-05 03:14:11 +08:00
|
|
|
command: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- a2enmod rewrite
|
|
|
|
- a2enmod fastcgi
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
2014-09-05 03:14:11 +08:00
|
|
|
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: install rados gateway vhost
|
2014-09-05 03:14:11 +08:00
|
|
|
template: >
|
|
|
|
src=rgw.conf
|
|
|
|
dest=/etc/apache2/sites-available/rgw.conf
|
|
|
|
owner=root
|
|
|
|
group=root
|
|
|
|
|
2015-07-07 17:19:50 +08:00
|
|
|
- name: enable rados gateway vhost and disable default site
|
2014-09-05 03:14:11 +08:00
|
|
|
command: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- a2ensite rgw.conf
|
2014-11-11 17:07:41 +08:00
|
|
|
- a2dissite *default
|
2015-06-26 06:26:03 +08:00
|
|
|
changed_when: false
|
|
|
|
ignore_errors: true
|
2014-09-05 03:14:11 +08:00
|
|
|
notify:
|
|
|
|
- restart apache2
|
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: install s3gw.fcgi script
|
2015-03-02 17:48:18 +08:00
|
|
|
template: >
|
|
|
|
src=s3gw.fcgi.j2
|
2014-09-05 03:14:11 +08:00
|
|
|
dest=/var/www/s3gw.fcgi
|
|
|
|
mode=0555
|
|
|
|
owner=root
|
|
|
|
group=root
|