diff --git a/roles/ceph-radosgw/tasks/install_debian.yml b/roles/ceph-radosgw/tasks/install_debian.yml index 1752f19ba..6d39a4490 100644 --- a/roles/ceph-radosgw/tasks/install_debian.yml +++ b/roles/ceph-radosgw/tasks/install_debian.yml @@ -1,12 +1,12 @@ --- -- 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 @@ -19,7 +19,7 @@ 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 @@ -32,7 +32,7 @@ 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: @@ -40,7 +40,7 @@ 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: @@ -48,14 +48,14 @@ 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 @@ -66,7 +66,7 @@ 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 @@ -77,7 +77,7 @@ 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 @@ -95,7 +95,7 @@ purge_default_apache.changed or purge_ceph_apache.changed -- name: install Apache and fastcgi +- name: install apache and fastcgi apt: > pkg={{ item }} state=present @@ -118,14 +118,14 @@ - 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 diff --git a/roles/ceph-radosgw/tasks/install_redhat.yml b/roles/ceph-radosgw/tasks/install_redhat.yml index 9be921d6c..7531d10b3 100644 --- a/roles/ceph-radosgw/tasks/install_redhat.yml +++ b/roles/ceph-radosgw/tasks/install_redhat.yml @@ -1,5 +1,5 @@ --- -- name: add Ceph extra +- name: add ceph extra template: > src=ceph-extra.repo dest=/etc/yum.repos.d @@ -13,7 +13,7 @@ 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 @@ -22,7 +22,7 @@ - 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 diff --git a/roles/ceph-radosgw/tasks/main.yml b/roles/ceph-radosgw/tasks/main.yml index 05f3d0070..f05123b21 100644 --- a/roles/ceph-radosgw/tasks/main.yml +++ b/roles/ceph-radosgw/tasks/main.yml @@ -14,7 +14,7 @@ radosgw_frontend == 'apache' and not ceph_containerized_deployment -- name: install Rados Gateway +- name: install rados gateway apt: > pkg=radosgw state=present @@ -23,7 +23,7 @@ ansible_os_family == 'Debian' and not ceph_containerized_deployment -- name: install Rados Gateway +- name: install rados gateway yum: > name=ceph-radosgw state=present diff --git a/roles/ceph-radosgw/tasks/openstack-keystone.yml b/roles/ceph-radosgw/tasks/openstack-keystone.yml index 09887f222..24306c2d8 100644 --- a/roles/ceph-radosgw/tasks/openstack-keystone.yml +++ b/roles/ceph-radosgw/tasks/openstack-keystone.yml @@ -1,5 +1,5 @@ --- -- name: create nss directory for Keystone certificates +- name: create nss directory for keystone certificates file: > path={{ radosgw_nss_db_path }} state=directory @@ -7,7 +7,7 @@ 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'" diff --git a/roles/ceph-radosgw/tasks/pre_requisite.yml b/roles/ceph-radosgw/tasks/pre_requisite.yml index fbd2114a8..fec0ed0f2 100644 --- a/roles/ceph-radosgw/tasks/pre_requisite.yml +++ b/roles/ceph-radosgw/tasks/pre_requisite.yml @@ -1,5 +1,5 @@ --- -- name: create RGW directories +- name: create rgw directories file: > path={{ item }} state=directory @@ -10,7 +10,7 @@ - /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 @@ -19,14 +19,14 @@ 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 @@ -34,7 +34,7 @@ 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 @@ -46,3 +46,17 @@ - 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" + diff --git a/roles/ceph-radosgw/tasks/start_radosgw.yml b/roles/ceph-radosgw/tasks/start_radosgw.yml index 53a510749..4781d5abf 100644 --- a/roles/ceph-radosgw/tasks/start_radosgw.yml +++ b/roles/ceph-radosgw/tasks/start_radosgw.yml @@ -1,23 +1,27 @@ --- -- 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