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
1=== modified file 'config.yaml'
2--- config.yaml 2014-10-23 10:35:26 +0000
3+++ config.yaml 2015-01-14 09:20:04 +0000
4@@ -57,3 +57,13 @@
5 100-continue. See the following page for more info:
6
7 http://ceph.com/docs/dumpling/radosgw/manual-install/#continue-support
8+ use-embedded-webserver:
9+ type: boolean
10+ default: false
11+ description: |
12+ Newer versions of the Ceph RADOS Gateway support use of an embedded web
13+ container instead of Apache + mod-fastcgi, avoiding some of the nuances
14+ of using the stock mod-fastcgi packages from Ubuntu.
15+ .
16+ Enable this option to disable use of Apache and enable the embedded
17+ web container feature.
18
19=== modified file 'hooks/hooks.py'
20--- hooks/hooks.py 2014-10-23 10:35:26 +0000
21+++ hooks/hooks.py 2015-01-14 09:20:04 +0000
22@@ -28,9 +28,13 @@
23 from charmhelpers.fetch import (
24 apt_update,
25 apt_install,
26+ apt_purge,
27 add_source,
28 )
29-from charmhelpers.core.host import lsb_release
30+from charmhelpers.core.host import (
31+ lsb_release,
32+ restart_on_change
33+)
34 from utils import (
35 render_template,
36 get_host_ip,
37@@ -68,16 +72,29 @@
38 add_source(source, key='6EAEAE2203C3951A')
39
40
41+PACKAGES = [
42+ 'radosgw',
43+ 'ntp',
44+]
45+
46+APACHE_PACKAGES = [
47+ 'libapache2-mod-fastcgi',
48+ 'apache2',
49+]
50+
51+
52 def install_packages():
53 add_source(config('source'), config('key'))
54- if config('use-ceph-optimised-packages'):
55+ if (config('use-ceph-optimised-packages') and
56+ not config('use-embedded-webserver')):
57 install_ceph_optimised_packages()
58
59 apt_update(fatal=True)
60- apt_install(['radosgw',
61- 'libapache2-mod-fastcgi',
62- 'apache2',
63- 'ntp'], fatal=True)
64+ apt_install(PACKAGES, fatal=True)
65+ if config('use-embedded-webserver'):
66+ apt_purge(APACHE_PACKAGES)
67+ else:
68+ apt_install(APACHE_PACKAGES, fatal=True)
69
70
71 @hooks.hook('install')
72@@ -98,7 +115,8 @@
73 'mon_hosts': ' '.join(get_mon_hosts()),
74 'hostname': get_unit_hostname(),
75 'old_auth': cmp_pkgrevno('radosgw', "0.51") < 0,
76- 'use_syslog': str(config('use-syslog')).lower()
77+ 'use_syslog': str(config('use-syslog')).lower(),
78+ 'embedded_webserver': config('use-embedded-webserver'),
79 }
80
81 # Check to ensure that correct version of ceph is
82@@ -143,14 +161,16 @@
83
84 @hooks.hook('upgrade-charm',
85 'config-changed')
86+@restart_on_change({'/etc/ceph/ceph.conf': ['radosgw']})
87 def config_changed():
88 install_packages()
89 emit_cephconf()
90- emit_apacheconf()
91- install_www_scripts()
92- apache_sites()
93- apache_modules()
94- apache_reload()
95+ if not config('use-embedded-webserver'):
96+ emit_apacheconf()
97+ install_www_scripts()
98+ apache_sites()
99+ apache_modules()
100+ apache_reload()
101
102
103 def get_mon_hosts():
104
105=== modified file 'templates/ceph.conf'
106--- templates/ceph.conf 2014-09-27 19:16:33 +0000
107+++ templates/ceph.conf 2015-01-14 09:20:04 +0000
108@@ -16,9 +16,13 @@
109 keyring = /etc/ceph/keyring.rados.gateway
110 rgw socket path = /tmp/radosgw.sock
111 log file = /var/log/ceph/radosgw.log
112+{% if embedded_webserver %}
113+rgw frontends = civetweb port=80
114+{% else %}
115 # Turn off 100-continue optimization as stock mod_fastcgi
116 # does not support it
117-rgw print continue = false
118+rgw print continue = false
119+{% endif %}
120 {% if auth_type == 'keystone' %}
121 rgw keystone url = {{ auth_protocol }}://{{ auth_host }}:{{ auth_port }}/
122 rgw keystone admin token = {{ admin_token }}

Subscribers

People subscribed via source and target branches