Merge lp:~james-page/charms/trusty/ceph-radosgw/embedded-webserver into lp:~openstack-charmers-archive/charms/trusty/ceph-radosgw/next

Proposed by James Page
Status: Merged
Merged at revision: 31
Proposed branch: lp:~james-page/charms/trusty/ceph-radosgw/embedded-webserver
Merge into: lp:~openstack-charmers-archive/charms/trusty/ceph-radosgw/next
Diff against target: 122 lines (+47/-13)
3 files modified
config.yaml (+10/-0)
hooks/hooks.py (+32/-12)
templates/ceph.conf (+5/-1)
To merge this branch: bzr merge lp:~james-page/charms/trusty/ceph-radosgw/embedded-webserver
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+246394@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Liam Young (gnuoy) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'config.yaml'
--- config.yaml 2014-10-23 10:35:26 +0000
+++ config.yaml 2015-01-14 09:20:04 +0000
@@ -57,3 +57,13 @@
57 100-continue. See the following page for more info:57 100-continue. See the following page for more info:
5858
59 http://ceph.com/docs/dumpling/radosgw/manual-install/#continue-support59 http://ceph.com/docs/dumpling/radosgw/manual-install/#continue-support
60 use-embedded-webserver:
61 type: boolean
62 default: false
63 description: |
64 Newer versions of the Ceph RADOS Gateway support use of an embedded web
65 container instead of Apache + mod-fastcgi, avoiding some of the nuances
66 of using the stock mod-fastcgi packages from Ubuntu.
67 .
68 Enable this option to disable use of Apache and enable the embedded
69 web container feature.
6070
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2014-10-23 10:35:26 +0000
+++ hooks/hooks.py 2015-01-14 09:20:04 +0000
@@ -28,9 +28,13 @@
28from charmhelpers.fetch import (28from charmhelpers.fetch import (
29 apt_update,29 apt_update,
30 apt_install,30 apt_install,
31 apt_purge,
31 add_source,32 add_source,
32)33)
33from charmhelpers.core.host import lsb_release34from charmhelpers.core.host import (
35 lsb_release,
36 restart_on_change
37)
34from utils import (38from utils import (
35 render_template,39 render_template,
36 get_host_ip,40 get_host_ip,
@@ -68,16 +72,29 @@
68 add_source(source, key='6EAEAE2203C3951A')72 add_source(source, key='6EAEAE2203C3951A')
6973
7074
75PACKAGES = [
76 'radosgw',
77 'ntp',
78]
79
80APACHE_PACKAGES = [
81 'libapache2-mod-fastcgi',
82 'apache2',
83]
84
85
71def install_packages():86def install_packages():
72 add_source(config('source'), config('key'))87 add_source(config('source'), config('key'))
73 if config('use-ceph-optimised-packages'):88 if (config('use-ceph-optimised-packages') and
89 not config('use-embedded-webserver')):
74 install_ceph_optimised_packages()90 install_ceph_optimised_packages()
7591
76 apt_update(fatal=True)92 apt_update(fatal=True)
77 apt_install(['radosgw',93 apt_install(PACKAGES, fatal=True)
78 'libapache2-mod-fastcgi',94 if config('use-embedded-webserver'):
79 'apache2',95 apt_purge(APACHE_PACKAGES)
80 'ntp'], fatal=True)96 else:
97 apt_install(APACHE_PACKAGES, fatal=True)
8198
8299
83@hooks.hook('install')100@hooks.hook('install')
@@ -98,7 +115,8 @@
98 'mon_hosts': ' '.join(get_mon_hosts()),115 'mon_hosts': ' '.join(get_mon_hosts()),
99 'hostname': get_unit_hostname(),116 'hostname': get_unit_hostname(),
100 'old_auth': cmp_pkgrevno('radosgw', "0.51") < 0,117 'old_auth': cmp_pkgrevno('radosgw', "0.51") < 0,
101 'use_syslog': str(config('use-syslog')).lower()118 'use_syslog': str(config('use-syslog')).lower(),
119 'embedded_webserver': config('use-embedded-webserver'),
102 }120 }
103121
104 # Check to ensure that correct version of ceph is122 # Check to ensure that correct version of ceph is
@@ -143,14 +161,16 @@
143161
144@hooks.hook('upgrade-charm',162@hooks.hook('upgrade-charm',
145 'config-changed')163 'config-changed')
164@restart_on_change({'/etc/ceph/ceph.conf': ['radosgw']})
146def config_changed():165def config_changed():
147 install_packages()166 install_packages()
148 emit_cephconf()167 emit_cephconf()
149 emit_apacheconf()168 if not config('use-embedded-webserver'):
150 install_www_scripts()169 emit_apacheconf()
151 apache_sites()170 install_www_scripts()
152 apache_modules()171 apache_sites()
153 apache_reload()172 apache_modules()
173 apache_reload()
154174
155175
156def get_mon_hosts():176def get_mon_hosts():
157177
=== modified file 'templates/ceph.conf'
--- templates/ceph.conf 2014-09-27 19:16:33 +0000
+++ templates/ceph.conf 2015-01-14 09:20:04 +0000
@@ -16,9 +16,13 @@
16keyring = /etc/ceph/keyring.rados.gateway16keyring = /etc/ceph/keyring.rados.gateway
17rgw socket path = /tmp/radosgw.sock17rgw socket path = /tmp/radosgw.sock
18log file = /var/log/ceph/radosgw.log18log file = /var/log/ceph/radosgw.log
19{% if embedded_webserver %}
20rgw frontends = civetweb port=80
21{% else %}
19# Turn off 100-continue optimization as stock mod_fastcgi22# Turn off 100-continue optimization as stock mod_fastcgi
20# does not support it23# does not support it
21rgw print continue = false 24rgw print continue = false
25{% endif %}
22{% if auth_type == 'keystone' %}26{% if auth_type == 'keystone' %}
23rgw keystone url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/27rgw keystone url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/
24rgw keystone admin token = {{ admin_token }}28rgw keystone admin token = {{ admin_token }}

Subscribers

People subscribed via source and target branches