From 7ed67f37d8e45bc4a97d2bb7b23719bae96d3ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 3 Aug 2015 17:39:57 +0200 Subject: [PATCH] Remove rgw installation from the ceph-rgw role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The installation of rgw is now handled by the ceph-common role. Fixes: #307 Signed-off-by: Sébastien Han --- group_vars/all.sample | 6 +++ group_vars/rgws.sample | 10 ----- roles/ceph-common/defaults/main.yml | 6 +++ roles/ceph-common/handlers/main.yml | 18 ++++++++ .../tasks/installs/install_on_debian.yml | 8 ++++ .../tasks/installs/install_on_redhat.yml | 7 ++++ .../tasks/installs/install_rgw_on_debian.yml} | 0 .../tasks/installs/install_rgw_on_redhat.yml} | 0 roles/ceph-common/tasks/main.yml | 14 ++++++- .../templates/ceph-extra.repo | 0 .../templates/ceph.j2 | 0 .../templates/httpd.conf | 0 .../templates/rgw.conf | 0 .../templates/s3gw.fcgi.j2 | 0 roles/ceph-rgw/defaults/main.yml | 10 ----- roles/ceph-rgw/files/cephdev.asc | 41 ------------------- roles/ceph-rgw/handlers/main.yml | 14 ------- roles/ceph-rgw/tasks/main.yml | 29 ------------- roles/ceph-rgw/tasks/start_radosgw.yml | 9 +++- 19 files changed, 66 insertions(+), 106 deletions(-) rename roles/{ceph-rgw/tasks/installs/install_debian.yml => ceph-common/tasks/installs/install_rgw_on_debian.yml} (100%) rename roles/{ceph-rgw/tasks/installs/install_redhat.yml => ceph-common/tasks/installs/install_rgw_on_redhat.yml} (100%) rename roles/{ceph-rgw => ceph-common}/templates/ceph-extra.repo (100%) rename roles/{ceph-rgw => ceph-common}/templates/ceph.j2 (100%) rename roles/{ceph-rgw => ceph-common}/templates/httpd.conf (100%) rename roles/{ceph-rgw => ceph-common}/templates/rgw.conf (100%) rename roles/{ceph-rgw => ceph-common}/templates/s3gw.fcgi.j2 (100%) delete mode 100644 roles/ceph-rgw/files/cephdev.asc delete mode 100644 roles/ceph-rgw/handlers/main.yml diff --git a/group_vars/all.sample b/group_vars/all.sample index e6da18694..71403ef35 100644 --- a/group_vars/all.sample +++ b/group_vars/all.sample @@ -171,6 +171,12 @@ dummy: #radosgw_keystone_revocation_internal: 900 #radosgw_s3_auth_use_keystone: "true" #radosgw_nss_db_path: /var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_hostname }}/nss +# Toggle 100-continue support for Apache and FastCGI +# WARNING: Changing this value will cause an outage of Apache while it is reinstalled on RGW nodes +#http_100_continue: false +# 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 +#email_address: foo@bar.com ## REST API options # diff --git a/group_vars/rgws.sample b/group_vars/rgws.sample index 15ff7150c..f0c930c5d 100644 --- a/group_vars/rgws.sample +++ b/group_vars/rgws.sample @@ -10,16 +10,6 @@ dummy: # allowing root to not require tty #radosgw_user: root -# Toggle 100-continue support for Apache and FastCGI -# WARNING: Changing this value will cause an outage of Apache while it is reinstalled on RGW nodes -#http_100_continue: false - -# 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 -#email_address: foo@bar.com -#radosgw_frontend: civetweb # we currently only support a single backend - - ########## # DOCKER # ########## diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 301520f9f..ba48c6459 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -179,6 +179,12 @@ radosgw_keystone_token_cache_size: 10000 radosgw_keystone_revocation_internal: 900 radosgw_s3_auth_use_keystone: "true" radosgw_nss_db_path: /var/lib/ceph/radosgw/ceph-radosgw.{{ ansible_hostname }}/nss +# Toggle 100-continue support for Apache and FastCGI +# WARNING: Changing this value will cause an outage of Apache while it is reinstalled on RGW nodes +http_100_continue: false +# 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 +email_address: foo@bar.com ## REST API options # diff --git a/roles/ceph-common/handlers/main.yml b/roles/ceph-common/handlers/main.yml index 0fd2f023a..f2c54aa82 100644 --- a/roles/ceph-common/handlers/main.yml +++ b/roles/ceph-common/handlers/main.yml @@ -64,3 +64,21 @@ socketrgw.rc == 0 and ansible_os_family == 'RedHat' and rgw_group_name in group_names + +- name: restart apache2 + service: > + name=apache2 + state=restarted + enabled=yes + when: + ansible_os_family == 'Debian' and + rgw_group_name in group_names + +- name: restart apache2 + service: > + name=httpd + state=restarted + enabled=yes + when: + ansible_os_family == 'RedHat' and + rgw_group_name in group_names diff --git a/roles/ceph-common/tasks/installs/install_on_debian.yml b/roles/ceph-common/tasks/installs/install_on_debian.yml index df129b0a5..d1813ed2c 100644 --- a/roles/ceph-common/tasks/installs/install_on_debian.yml +++ b/roles/ceph-common/tasks/installs/install_on_debian.yml @@ -61,6 +61,14 @@ - ceph-mds #|--> they don't get update so we need to force them - libcephfs1 #| +- name: install rados gateway + apt: > + pkg=radosgw + state=present + update_cache=yes + when: + rgw_group_name in group_names + - name: configure rbd clients directories file: > path={{ item }} diff --git a/roles/ceph-common/tasks/installs/install_on_redhat.yml b/roles/ceph-common/tasks/installs/install_on_redhat.yml index d8fbfe6f8..d133250b6 100644 --- a/roles/ceph-common/tasks/installs/install_on_redhat.yml +++ b/roles/ceph-common/tasks/installs/install_on_redhat.yml @@ -102,6 +102,13 @@ - "{{ ceph_stable_ice_temp_path }}/kmod-rbd-{{ ceph_stable_ice_kmod }}.rpm" when: ceph_stable_ice +- name: install rados gateway + yum: > + name=ceph-radosgw + state=present + when: + rgw_group_name in group_names + - name: configure rbd clients directories file: > path={{ item }} diff --git a/roles/ceph-rgw/tasks/installs/install_debian.yml b/roles/ceph-common/tasks/installs/install_rgw_on_debian.yml similarity index 100% rename from roles/ceph-rgw/tasks/installs/install_debian.yml rename to roles/ceph-common/tasks/installs/install_rgw_on_debian.yml diff --git a/roles/ceph-rgw/tasks/installs/install_redhat.yml b/roles/ceph-common/tasks/installs/install_rgw_on_redhat.yml similarity index 100% rename from roles/ceph-rgw/tasks/installs/install_redhat.yml rename to roles/ceph-common/tasks/installs/install_rgw_on_redhat.yml diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index fd840e0e9..3d46fa337 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -25,6 +25,18 @@ - include: ./installs/install_on_debian.yml when: ansible_os_family == 'Debian' +- include: ./installs/install_rgw_on_redhat.yml + when: + ansible_os_family == 'RedHat' and + radosgw_frontend == 'apache' and + rgw_group_name in group_names + +- include: ./installs/install_rgw_on_debian.yml + when: + ansible_os_family == 'Debian' and + radosgw_frontend == 'apache' and + rgw_group_name in group_names + - name: check for a ceph socket shell: "stat /var/run/ceph/*.asok > /dev/null 2>&1" changed_when: false @@ -38,7 +50,7 @@ register: socketrgw - name: create a local fetch directory if it doesn't exist - local_action: file path=fetch state=directory + local_action: file path=fetch state=directory changed_when: false sudo: false diff --git a/roles/ceph-rgw/templates/ceph-extra.repo b/roles/ceph-common/templates/ceph-extra.repo similarity index 100% rename from roles/ceph-rgw/templates/ceph-extra.repo rename to roles/ceph-common/templates/ceph-extra.repo diff --git a/roles/ceph-rgw/templates/ceph.j2 b/roles/ceph-common/templates/ceph.j2 similarity index 100% rename from roles/ceph-rgw/templates/ceph.j2 rename to roles/ceph-common/templates/ceph.j2 diff --git a/roles/ceph-rgw/templates/httpd.conf b/roles/ceph-common/templates/httpd.conf similarity index 100% rename from roles/ceph-rgw/templates/httpd.conf rename to roles/ceph-common/templates/httpd.conf diff --git a/roles/ceph-rgw/templates/rgw.conf b/roles/ceph-common/templates/rgw.conf similarity index 100% rename from roles/ceph-rgw/templates/rgw.conf rename to roles/ceph-common/templates/rgw.conf diff --git a/roles/ceph-rgw/templates/s3gw.fcgi.j2 b/roles/ceph-common/templates/s3gw.fcgi.j2 similarity index 100% rename from roles/ceph-rgw/templates/s3gw.fcgi.j2 rename to roles/ceph-common/templates/s3gw.fcgi.j2 diff --git a/roles/ceph-rgw/defaults/main.yml b/roles/ceph-rgw/defaults/main.yml index 1046e481e..1a482acee 100644 --- a/roles/ceph-rgw/defaults/main.yml +++ b/roles/ceph-rgw/defaults/main.yml @@ -10,16 +10,6 @@ cephx: true # allowing root to not require tty radosgw_user: root -# Toggle 100-continue support for Apache and FastCGI -# WARNING: Changing this value will cause an outage of Apache while it is reinstalled on RGW nodes -http_100_continue: false - -# 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 -email_address: foo@bar.com -radosgw_frontend: civetweb # we currently only support a single backend - - ########## # DOCKER # ########## diff --git a/roles/ceph-rgw/files/cephdev.asc b/roles/ceph-rgw/files/cephdev.asc deleted file mode 100644 index e43bd6c6e..000000000 --- a/roles/ceph-rgw/files/cephdev.asc +++ /dev/null @@ -1,41 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.10 (GNU/Linux) - -mQGiBE1Rr28RBADCxdpLV3ea9ocpS/1+UCvHqD5xjmlw/9dmji4qrUX0+IhPMNuA -GBBt2CRaR7ygMF5S0NFXooegph0/+NT0KisLIuhUI3gde4SWb5jsb8hpGUse9MC5 -DN39P46zZSpepIMlQuQUkge8W/H2qBu10RcwQhs7o2fZ1zK9F3MmRCkBqwCggpap -GsOgE2IlWjcztmE6xcPO0wED/R4BxTaQM+jxIjylnHgn9PYy6795yIc/ZoYjNnIh -QyjqbLWnyzeTmjPBwcXNljKqzEoA/Cjb2gClxHXrYAw7bGu7wKbnqhzdghSx7ab+ -HwIoy/v6IQq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jdyg/Flp2VlWVtAHFLzkC -a+LvQ5twSuzrV/VipSr3xz3pTDLY+ZxDztvrgA6AST8+sdq6uQTYjwUQV0wzanvp -9hkC5eqRY6YlzcgMkWFv8DCIEwADBQ//ZQaeVmG6T5vyfXf2JrCipmI4MAdO+ezE -tWE82wgixlCvvm26UmUejCYgtD6DmwY/7/bIjvJDhUwP0+hAHHOpR62gncoMtbMr -yHpm3FvYH58JNk5gx8ZA322WEc2GCRCQzrMQoMKBcpZY/703GpQ4l3RZ7/25gq7A -NohV5zeddFQftc05PMBBJLU3U+lrnahJS1WaOXNQzS6oVj9jNda1jkgcQni6QssS -IMT6rAPsVbGJhe9mxr2VWdQ90QlubpszIeSJuqqJxLwqH8XHXZmQOYxmyVP9a3pF -qWDmsNxDA8ttYnMIc+nUAgCDJ84ScwQ1GvoCUD1b1cFNzvvhEHsNb4D/XbdrFcFG -wEkeyivUsojdq2YnGjYSgauqyNWbeEgBrWzUe5USYysmziL/KAubcUjIbeRGxyPS -6iQ2kbvfEJJPgocWTfLs5j61FObO+MVlj+PEmxWbcsIRv/pnG2V2FPJ8evhzgvp7 -cG9imZPM6dWHzc/ZFdi3Bcs51RtStsvPqXv4icKIi+01h1MLHNBqwuUkIiiK7ooM -lvnp+DiEsVSuYYKBdGTi+4+nduuYL2g8CTNJKZuC46dY7EcE3lRYZlxl7dwN3jfL -PRlnNscs34dwhZa+b70Flia0U1DNF4jrIFFBSHD3TqMg0Z6kxp1TfxpeGOLOqnBW -rr0GKehu9CGISQQYEQIACQIbDAUCURSbegAKCRBurq4iA8OVGv9TAJ9EeXVrRS3p -PZkT1R21FszUc9LvmgCeMduh5IPGFWSx9MjUc7/j1QKYm7g= -=per8 ------END PGP PUBLIC KEY BLOCK----- diff --git a/roles/ceph-rgw/handlers/main.yml b/roles/ceph-rgw/handlers/main.yml deleted file mode 100644 index 06c73989a..000000000 --- a/roles/ceph-rgw/handlers/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: restart apache2 - service: > - name=apache2 - state=restarted - enabled=yes - when: ansible_os_family == 'Debian' - -- name: restart apache2 - service: > - name=httpd - state=restarted - enabled=yes - when: ansible_os_family == 'RedHat' diff --git a/roles/ceph-rgw/tasks/main.yml b/roles/ceph-rgw/tasks/main.yml index 04d1bf8d3..7b7e73057 100644 --- a/roles/ceph-rgw/tasks/main.yml +++ b/roles/ceph-rgw/tasks/main.yml @@ -2,35 +2,6 @@ - include: pre_requisite.yml when: not ceph_containerized_deployment -- include: ./installs/install_redhat.yml - when: - ansible_os_family == 'RedHat' and - radosgw_frontend == 'apache' and not - ceph_containerized_deployment - -- include: ./installs/install_debian.yml - when: - ansible_os_family == 'Debian' and - radosgw_frontend == 'apache' and not - ceph_containerized_deployment - -- name: install rados gateway - apt: > - pkg=radosgw - state=present - update_cache=yes - when: - ansible_os_family == 'Debian' and not - ceph_containerized_deployment - -- name: install rados gateway - yum: > - name=ceph-radosgw - state=present - when: - ansible_os_family == 'RedHat' and not - ceph_containerized_deployment - - include: openstack-keystone.yml when: radosgw_keystone diff --git a/roles/ceph-rgw/tasks/start_radosgw.yml b/roles/ceph-rgw/tasks/start_radosgw.yml index 2301b4974..f67ed9299 100644 --- a/roles/ceph-rgw/tasks/start_radosgw.yml +++ b/roles/ceph-rgw/tasks/start_radosgw.yml @@ -2,6 +2,7 @@ - name: check if rgw is started command: /etc/init.d/radosgw status register: rgwstatus + changed_when: false failed_when: false - name: start rgw @@ -11,9 +12,15 @@ ansible_distribution != "Ubuntu" and ansible_os_family != 'RedHat' +- name: activate rgw on ubuntu + command: initctl emit radosgw cluster=ceph id=rgw.{{ ansible_hostname }} + changed_when: false + when: ansible_distribution == 'Ubuntu' + - name: start rgw on ubuntu service: > - name=radosgw-all + name=radosgw + args=id=rgw.{{ ansible_hostname }} state=started when: ansible_distribution == 'Ubuntu'