diff --git a/config.yaml b/config.yaml index 3871b048..469bef34 100644 --- a/config.yaml +++ b/config.yaml @@ -47,3 +47,13 @@ options: default: False description: | If set to True, supporting services will log to syslog. + use-ceph-optimised-packages: + type: boolean + default: false + description: | + By default apache2 and libapache2-mod-fastcgi will be installed from the + Ubuntu archives. This option allows for an alternate ceph.com install + source which contains patched versions with added support for HTTP + 100-continue. See the following page for more info: + + http://ceph.com/docs/dumpling/radosgw/manual-install/#continue-support diff --git a/hooks/hooks.py b/hooks/hooks.py index 17636729..cdc7053a 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -30,6 +30,7 @@ from charmhelpers.fetch import ( apt_install, add_source, ) +from charmhelpers.core.host import lsb_release from utils import ( render_template, get_host_ip, @@ -52,16 +53,38 @@ def install_www_scripts(): NSS_DIR = '/var/lib/ceph/nss' -@hooks.hook('install') -def install(): - execd_preinstall() - enable_pocket('multiverse') +def install_ceph_optimised_packages(): + """Inktank provides patched/optimised packages for HTTP 100-continue + support that does has not yet been ported to upstream. These can + optionally be installed from ceph.com archives. + """ + prolog = "http://gitbuilder.ceph.com/" + epilog = "-x86_64-basic/ref/master" + rel = lsb_release()['DISTRIB_CODENAME'] + fastcgi_source = "%slibapache-mod-fastcgi-deb-%s%s" % (prolog, rel, epilog) + apache_source = "%sapache2-deb-%s%s" % (prolog, rel, epilog) + + for source in [fastcgi_source, apache_source]: + add_source(source, key='6EAEAE2203C3951A') + + +def install_packages(): add_source(config('source'), config('key')) + if config('use-ceph-optimised-packages'): + install_ceph_optimised_packages() + apt_update(fatal=True) apt_install(['radosgw', 'libapache2-mod-fastcgi', 'apache2', 'ntp'], fatal=True) + + +@hooks.hook('install') +def install(): + execd_preinstall() + enable_pocket('multiverse') + install_packages() os.makedirs(NSS_DIR) @@ -121,6 +144,7 @@ def apache_reload(): @hooks.hook('upgrade-charm', 'config-changed') def config_changed(): + install_packages() emit_cephconf() emit_apacheconf() install_www_scripts()