---
-- name: add Ceph extra
+- 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']
# NOTE (leseb): 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
+- name: enable multiverse repo for precise
apt_repository: >
repo="{{ item }}"
state=present
http_100_continue
# NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages
-- name: disable multiverse repo for Precise
+- name: disable multiverse repo for precise
apt_repository: >
repo="{{ item }}"
state=absent
http_100_continue
# NOTE (leseb): 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
+- name: enable multiverse repo for trusty
command: "apt-add-repository multiverse"
changed_when: false
when:
http_100_continue
# NOTE (leseb): disable the repo when we are using the Ceph repo for 100-continue packages
-- name: disable multiverse repo for Trusty
+- name: disable multiverse repo for trusty
command: "apt-add-repository -r multiverse"
changed_when: false
when:
http_100_continue
# NOTE (leseb): if using 100-continue, add Ceph dev key
-- name: install the Ceph development repository key
+- name: install the ceph development repository key
apt_key: >
data="{{ lookup('file', 'cephdev.asc') }}"
state=present
when: http_100_continue
# NOTE (leseb): if using 100-continue, add Ceph sources and update
-- name: add Ceph Apache and FastCGI sources
+- name: add ceph apache and fastcgi sources
apt_repository: >
repo="{{ item }}"
state=present
when: http_100_continue
# NOTE (leseb): else remove them to ensure you use the default packages
-- name: remove Ceph Apache and FastCGI sources
+- name: remove ceph apache and fastcgi sources
apt_repository: >
repo="{{ item }}"
state=absent
when: not http_100_continue
# NOTE (leseb): purge Ceph Apache and FastCGI packages if needed
-- name: purge Ceph Apache and FastCGI packages
+- name: purge ceph apache and fastcgi packages
apt: >
pkg="{{ item }}"
state=absent
purge_default_apache.changed or
purge_ceph_apache.changed
-- name: install Apache and fastcgi
+- name: install apache and fastcgi
apt: >
pkg={{ item }}
state=present
- a2enmod fastcgi
changed_when: false
-- name: install Rados Gateway vhost
+- name: install rados gateway vhost
template: >
src=rgw.conf
dest=/etc/apache2/sites-available/rgw.conf
owner=root
group=root
-- name: enable Rados Gateway vhost and disable default site
+- name: enable rados gateway vhost and disable default site
command: "{{ item }}"
with_items:
- a2ensite rgw.conf
---
-- name: add Ceph extra
+- name: add ceph extra
template: >
src=ceph-extra.repo
dest=/etc/yum.repos.d
command: rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
changed_when: false
-- name: install Apache and fastcgi
+- name: install apache and fastcgi
yum: >
name={{ item }}
state=present
- mod_fastcgi
- mod_fcgid
-- name: install Rados Gateway vhost
+- name: install rados gateway vhost
template: >
src=rgw.conf
dest=/etc/httpd/conf.d/rgw.conf
radosgw_frontend == 'apache' and not
ceph_containerized_deployment
-- name: install Rados Gateway
+- name: install rados gateway
apt: >
pkg=radosgw
state=present
ansible_os_family == 'Debian' and not
ceph_containerized_deployment
-- name: install Rados Gateway
+- name: install rados gateway
yum: >
name=ceph-radosgw
state=present
---
-- name: create nss directory for Keystone certificates
+- name: create nss directory for keystone certificates
file: >
path={{ radosgw_nss_db_path }}
state=directory
group=root
mode=0644
-- name: create nss entries for Keystone certificates
+- name: create nss entries for keystone certificates
shell: "{{ item }}"
with_items:
- "openssl x509 -in /etc/keystone/ssl/certs/ca.pem -pubkey |certutil -d {{ radosgw_nss_db_path }} -A -n ca -t 'TCu,Cu,Tuw'"
---
-- name: create RGW directories
+- name: create rgw directories
file: >
path={{ item }}
state=directory
- /var/lib/ceph/bootstrap-rgw
- /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}
-- name: copy RGW bootstrap key
+- name: copy rgw bootstrap key
copy: >
src=fetch/{{ fsid }}/var/lib/ceph/bootstrap-rgw/ceph.keyring
dest=/var/lib/ceph/bootstrap-rgw/ceph.keyring
mode=600
when: cephx
-- name: create RGW keyring
+- name: create rgw keyring
command: >
ceph --cluster ceph --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/ceph.keyring auth get-or-create client.rgw.{{ ansible_hostname }} osd 'allow rwx' mon 'allow rw' -o /var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
creates=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
changed_when: false
when: cephx
-- name: set RGW key permissions
+- name: set rgw key permissions
file: >
path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/keyring
mode=0600
group=root
when: cephx
-- name: activate RGW with upstart
+- name: activate rgw with upstart
file: >
path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }}
state=touch
- upstart
changed_when: false
when: ansible_distribution == "Ubuntu"
+
+- name: activate rgw with sysvinit
+ file: >
+ path=/var/lib/ceph/radosgw/ceph-rgw.{{ ansible_hostname }}/{{ item }}
+ state=touch
+ owner=root
+ group=root
+ mode=0644
+ with_items:
+ - done
+ - sysvinit
+ changed_when: false
+ when: ansible_distribution != "Ubuntu"
+
---
-- name: check if RGW is started
+- name: check if rgw is started
command: /etc/init.d/radosgw status
register: rgwstatus
ignore_errors: true
-- name: start RGW
+- name: start rgw
command: /etc/init.d/radosgw start
when:
rgwstatus.rc != 0 and
ansible_distribution != "Ubuntu" and
ansible_os_family != 'RedHat'
-- name: start RGW
+- name: start rgw
service: >
name=radosgw-all
state=started
when: ansible_distribution == "Ubuntu"
-- name: start RGW
+- name: activate rgw service
+ command: systemctl enable ceph-radosgw.service
+ when: ansible_os_family == 'RedHat'
+
+- name: start rgw
service: >
name=ceph-radosgw
state=started