From accbfeff318aa1ceb5e161ae9a10b142c6712ef9 Mon Sep 17 00:00:00 2001 From: Matthew Rees Date: Fri, 14 Nov 2014 16:05:56 +0200 Subject: [PATCH 1/3] Support for 100-continue toggling for RGW Tested for Precise and Trusty. --- roles/ceph-common/tasks/install_on_debian.yml | 2 +- roles/ceph-common/tasks/install_on_redhat.yml | 2 +- roles/ceph-common/vars/main.yml | 5 +- roles/ceph-radosgw/files/cephdev.asc | 41 +++++++++++ roles/ceph-radosgw/tasks/install_debian.yml | 71 +++++++++++++++++-- roles/ceph-radosgw/vars/main.yml | 4 ++ 6 files changed, 115 insertions(+), 10 deletions(-) create mode 100644 roles/ceph-radosgw/files/cephdev.asc diff --git a/roles/ceph-common/tasks/install_on_debian.yml b/roles/ceph-common/tasks/install_on_debian.yml index 972210065..256b28ce7 100644 --- a/roles/ceph-common/tasks/install_on_debian.yml +++ b/roles/ceph-common/tasks/install_on_debian.yml @@ -16,7 +16,7 @@ state=present when: ceph_stable -- name: Install the Ceph developement repository key +- name: Install the Ceph development repository key apt_key: > data="{{ lookup('file', 'cephdev.asc') }}" state=present diff --git a/roles/ceph-common/tasks/install_on_redhat.yml b/roles/ceph-common/tasks/install_on_redhat.yml index f911af9b7..54fb64479 100644 --- a/roles/ceph-common/tasks/install_on_redhat.yml +++ b/roles/ceph-common/tasks/install_on_redhat.yml @@ -14,7 +14,7 @@ state=present when: ceph_stable -- name: Install the Ceph developement repository key +- name: Install the Ceph development repository key rpm_key: > key={{ ceph_dev_key }} state=present diff --git a/roles/ceph-common/vars/main.yml b/roles/ceph-common/vars/main.yml index 79382fc80..bcfc58f80 100644 --- a/roles/ceph-common/vars/main.yml +++ b/roles/ceph-common/vars/main.yml @@ -16,9 +16,10 @@ ceph_stable_release: giant # ceph stable release # # supported distros are el6, rhel6, f18, f19, opensuse12.2, sles11, centos7 (see http://ceph.com/rpm-firefly/) ceph_stable_redhat_distro: el7 -ceph_dev: false # use ceph developement branch +ceph_dev: false # use ceph development branch ceph_dev_key: https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/autobuild.asc -ceph_dev_branch: master # developement branch you would like to use e.g: master, wip-hack +ceph_dev_branch: master # development branch you would like to use e.g: master, wip-hack + # supported distros are centos6, centos7, fc17, fc18, fc19, fc20, fedora17, fedora18, # fedora19, fedora20, opensuse12, sles0. (see http://gitbuilder.ceph.com/). # For rhel, please pay attention to the versions: 'rhel6 3' or 'rhel 4', the fullname is _very_ important. diff --git a/roles/ceph-radosgw/files/cephdev.asc b/roles/ceph-radosgw/files/cephdev.asc new file mode 100644 index 000000000..e43bd6c6e --- /dev/null +++ b/roles/ceph-radosgw/files/cephdev.asc @@ -0,0 +1,41 @@ +-----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/v6IQqv+EXZgYHonqQwqtgfAHp5ON2gWu03cHoGkXfmA4qZIoowqMolZhGo +cF30A/9GotDdnMlqh8bFBOCMuxfRow7H8RpfL0fX7VHA0knAZEDk2rNFeebL5QKH +GNJm9Wa6JSVj1NUIaz4LHyravqXi4MXzlUqauhLHw1iG+qwZlPM04z+1Dj6A+2Hr +b5UxI/I+EzmO5OYa38YWOqybNVBH0wO+sMCpdBq0LABa8X29LbRPQ2VwaCBhdXRv +bWF0ZWQgcGFja2FnZSBidWlsZCAoQ2VwaCBhdXRvbWF0ZWQgcGFja2FnZSBidWls +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aOXNQzS6oVj9jNda1jkgcQni6QssS +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-radosgw/tasks/install_debian.yml b/roles/ceph-radosgw/tasks/install_debian.yml index 74c42f4ad..aff7cd21f 100644 --- a/roles/ceph-radosgw/tasks/install_debian.yml +++ b/roles/ceph-radosgw/tasks/install_debian.yml @@ -8,18 +8,77 @@ state=present when: ansible_lsb.codename in ['natty', 'oneiric', 'precise', 'quantal', 'raring', 'sid', 'squeeze', 'wheezy'] -# Needed for Ubuntu 14.04 to have access to libapache2-mod-fastcgi -- name: Enable multiverse repo for fastcgi package access - command: "apt-add-repository multiverse" - when: ansible_lsb.codename in ['trusty'] +# 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 + command: "sed -i '/^# deb .* multiverse$/ s/^# //' /etc/apt/sources.list" + 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 + command: "sed -i '/^deb .* multiverse$/ s/^/# /' /etc/apt/sources.list" + 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 + +# 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 + +# 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 -# update_cache needed for step above - name: "Install Apache, fastcgi and Rados Gateway" apt: > pkg={{ item }} state=present update_cache=yes - cache_valid_time=3600 with_items: - apache2 - libapache2-mod-fastcgi diff --git a/roles/ceph-radosgw/vars/main.yml b/roles/ceph-radosgw/vars/main.yml index e2fa05f34..e4c31ef37 100644 --- a/roles/ceph-radosgw/vars/main.yml +++ b/roles/ceph-radosgw/vars/main.yml @@ -5,6 +5,10 @@ # cephx: true +# 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 From 4258dac2517c5e4d057b4f6cdeb493900b3ddb54 Mon Sep 17 00:00:00 2001 From: Matthew Rees Date: Fri, 14 Nov 2014 16:48:21 +0200 Subject: [PATCH 2/3] Change to shell from command --- roles/ceph-radosgw/tasks/install_debian.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ceph-radosgw/tasks/install_debian.yml b/roles/ceph-radosgw/tasks/install_debian.yml index aff7cd21f..970da1fc4 100644 --- a/roles/ceph-radosgw/tasks/install_debian.yml +++ b/roles/ceph-radosgw/tasks/install_debian.yml @@ -10,12 +10,12 @@ # 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 - command: "sed -i '/^# deb .* multiverse$/ s/^# //' /etc/apt/sources.list" + shell: "sed -i '/^# deb .* multiverse$/ s/^# //' /etc/apt/sources.list" 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 - command: "sed -i '/^deb .* multiverse$/ s/^/# /' /etc/apt/sources.list" + shell: "sed -i '/^deb .* multiverse$/ s/^/# /' /etc/apt/sources.list" 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 From e07e0b5be406d8a39694244e911c29242be982dc Mon Sep 17 00:00:00 2001 From: Matthew Rees Date: Mon, 17 Nov 2014 12:11:48 +0200 Subject: [PATCH 3/3] Replaced shell based sed with apt_repo module call --- roles/ceph-radosgw/tasks/install_debian.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/roles/ceph-radosgw/tasks/install_debian.yml b/roles/ceph-radosgw/tasks/install_debian.yml index 970da1fc4..3460a22e4 100644 --- a/roles/ceph-radosgw/tasks/install_debian.yml +++ b/roles/ceph-radosgw/tasks/install_debian.yml @@ -10,12 +10,24 @@ # 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 - shell: "sed -i '/^# deb .* multiverse$/ s/^# //' /etc/apt/sources.list" + 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 - shell: "sed -i '/^deb .* multiverse$/ s/^/# /' /etc/apt/sources.list" + 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