Merge lp:~james-page/charms/raring/ceph/trunk into lp:~charmers/charms/precise/ceph/trunk
- Raring Ringtail (13.04)
- trunk
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Mark Mims |
Approved revision: | 60 |
Merged at revision: | 54 |
Proposed branch: | lp:~james-page/charms/raring/ceph/trunk |
Merge into: | lp:~charmers/charms/precise/ceph/trunk |
Diff against target: |
385 lines (+157/-23) 6 files modified
config.yaml (+19/-1) hooks/ceph.py (+26/-0) hooks/hooks.py (+58/-11) hooks/utils.py (+47/-10) revision (+1/-1) templates/ceph.conf (+6/-0) |
To merge this branch: | bzr merge lp:~james-page/charms/raring/ceph/trunk |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mark Mims (community) | Approve | ||
Review via email: mp+142897@code.launchpad.net |
Commit message
Description of the change
Updates to support newer releases of ceph.
Updates are backwards compatibile with precise/0.48.x series and have been testing using the following combos:
precise/0.48.2
quantal/0.48.2
raring/0.56.1
- 59. By James Page
-
Improve host ip resolution - fixes issues with maas managed DNS
Jim Baker (jimbaker) wrote : | # |
- 60. By James Page
-
Allow get_host_ip helper to raise exception in the event that a IP address
cannot be resolved for the provided hostname.
Mark Mims (mark-mims) wrote : | # |
this looks great.
This MP exposes a flaw in our current charm subnmission process. The alias lp:charms/ceph points to lp:~charmers/charms/precise/ceph/trunk. However, the proposed merge is from a raring branch. Should it go to precise, quantal, or should we do a new lp:~charmers/charms/raring/ceph/trunk and leave this merge out of the past series branches?
I'd reject because there's ambiguity in which branch(es) you'd like this merged into... but after talking on IRC, the branches are intended for precise even though they're raring branches. In the future we should submit against a specific series branch if that's possible and what you mean to do... otherwise, at least note the intended destination in the MP somewhere.
Thanks!
Preview Diff
1 | === renamed file 'README' => 'README.md' | |||
2 | === modified file 'config.yaml' | |||
3 | --- config.yaml 2012-11-22 10:47:03 +0000 | |||
4 | +++ config.yaml 2013-02-07 16:02:24 +0000 | |||
5 | @@ -39,6 +39,24 @@ | |||
6 | 39 | . | 39 | . |
7 | 40 | These devices are the range of devices that will be checked for and | 40 | These devices are the range of devices that will be checked for and |
8 | 41 | used across all service units. | 41 | used across all service units. |
9 | 42 | osd-journal: | ||
10 | 43 | type: string | ||
11 | 44 | description: | | ||
12 | 45 | The device to use as a shared journal drive for all OSD's. By default | ||
13 | 46 | no journal device will be used. | ||
14 | 47 | . | ||
15 | 48 | Only supported with ceph >= 0.55. | ||
16 | 49 | osd-format: | ||
17 | 50 | type: string | ||
18 | 51 | default: xfs | ||
19 | 52 | description: | | ||
20 | 53 | Format of filesystem to use for OSD devices; supported formats include: | ||
21 | 54 | . | ||
22 | 55 | xfs (Default >= 0.55) | ||
23 | 56 | ext4 (Only option < 0.55) | ||
24 | 57 | btrfs (experimental and not recommended) | ||
25 | 58 | . | ||
26 | 59 | Only supported with ceph >= 0.55. | ||
27 | 42 | osd-reformat: | 60 | osd-reformat: |
28 | 43 | type: string | 61 | type: string |
29 | 44 | description: | | 62 | description: | |
30 | @@ -47,7 +65,7 @@ | |||
31 | 47 | prevent data loss. | 65 | prevent data loss. |
32 | 48 | . | 66 | . |
33 | 49 | Specifying this option (any value) forces a reformat of any OSD devices | 67 | Specifying this option (any value) forces a reformat of any OSD devices |
35 | 50 | found which are not already mounted. | 68 | found which are not already mounted. |
36 | 51 | ephemeral-unmount: | 69 | ephemeral-unmount: |
37 | 52 | type: string | 70 | type: string |
38 | 53 | description: | | 71 | description: | |
39 | 54 | 72 | ||
40 | === modified file 'hooks/ceph.py' | |||
41 | --- hooks/ceph.py 2012-10-19 15:50:18 +0000 | |||
42 | +++ hooks/ceph.py 2013-02-07 16:02:24 +0000 | |||
43 | @@ -12,6 +12,7 @@ | |||
44 | 12 | import time | 12 | import time |
45 | 13 | import utils | 13 | import utils |
46 | 14 | import os | 14 | import os |
47 | 15 | import apt_pkg as apt | ||
48 | 15 | 16 | ||
49 | 16 | LEADER = 'leader' | 17 | LEADER = 'leader' |
50 | 17 | PEON = 'peon' | 18 | PEON = 'peon' |
51 | @@ -84,6 +85,12 @@ | |||
52 | 84 | # Ignore any errors for this call | 85 | # Ignore any errors for this call |
53 | 85 | subprocess.call(cmd) | 86 | subprocess.call(cmd) |
54 | 86 | 87 | ||
55 | 88 | DISK_FORMATS = [ | ||
56 | 89 | 'xfs', | ||
57 | 90 | 'ext4', | ||
58 | 91 | 'btrfs' | ||
59 | 92 | ] | ||
60 | 93 | |||
61 | 87 | 94 | ||
62 | 88 | def is_osd_disk(dev): | 95 | def is_osd_disk(dev): |
63 | 89 | try: | 96 | try: |
64 | @@ -108,6 +115,11 @@ | |||
65 | 108 | subprocess.call(cmd) | 115 | subprocess.call(cmd) |
66 | 109 | 116 | ||
67 | 110 | 117 | ||
68 | 118 | def zap_disk(dev): | ||
69 | 119 | cmd = ['sgdisk', '--zap-all', dev] | ||
70 | 120 | subprocess.check_call(cmd) | ||
71 | 121 | |||
72 | 122 | |||
73 | 111 | _bootstrap_keyring = "/var/lib/ceph/bootstrap-osd/ceph.keyring" | 123 | _bootstrap_keyring = "/var/lib/ceph/bootstrap-osd/ceph.keyring" |
74 | 112 | 124 | ||
75 | 113 | 125 | ||
76 | @@ -207,3 +219,17 @@ | |||
77 | 207 | if 'key' in element: | 219 | if 'key' in element: |
78 | 208 | key = element.split(' = ')[1].strip() # IGNORE:E1103 | 220 | key = element.split(' = ')[1].strip() # IGNORE:E1103 |
79 | 209 | return key | 221 | return key |
80 | 222 | |||
81 | 223 | |||
82 | 224 | def get_ceph_version(): | ||
83 | 225 | apt.init() | ||
84 | 226 | cache = apt.Cache() | ||
85 | 227 | pkg = cache['ceph'] | ||
86 | 228 | if pkg.current_ver: | ||
87 | 229 | return apt.upstream_version(pkg.current_ver.ver_str) | ||
88 | 230 | else: | ||
89 | 231 | return None | ||
90 | 232 | |||
91 | 233 | |||
92 | 234 | def version_compare(a, b): | ||
93 | 235 | return apt.version_compare(a, b) | ||
94 | 210 | 236 | ||
95 | === modified file 'hooks/hooks.py' | |||
96 | --- hooks/hooks.py 2012-11-12 10:00:27 +0000 | |||
97 | +++ hooks/hooks.py 2013-02-07 16:02:24 +0000 | |||
98 | @@ -19,14 +19,16 @@ | |||
99 | 19 | 19 | ||
100 | 20 | 20 | ||
101 | 21 | def install_upstart_scripts(): | 21 | def install_upstart_scripts(): |
104 | 22 | for x in glob.glob('files/upstart/*.conf'): | 22 | # Only install upstart configurations for older versions |
105 | 23 | shutil.copy(x, '/etc/init/') | 23 | if ceph.get_ceph_version() < "0.55.1": |
106 | 24 | for x in glob.glob('files/upstart/*.conf'): | ||
107 | 25 | shutil.copy(x, '/etc/init/') | ||
108 | 24 | 26 | ||
109 | 25 | 27 | ||
110 | 26 | def install(): | 28 | def install(): |
111 | 27 | utils.juju_log('INFO', 'Begin install hook.') | 29 | utils.juju_log('INFO', 'Begin install hook.') |
112 | 28 | utils.configure_source() | 30 | utils.configure_source() |
114 | 29 | utils.install('ceph', 'gdisk', 'ntp') | 31 | utils.install('ceph', 'gdisk', 'ntp', 'btrfs-tools') |
115 | 30 | install_upstart_scripts() | 32 | install_upstart_scripts() |
116 | 31 | utils.juju_log('INFO', 'End install hook.') | 33 | utils.juju_log('INFO', 'End install hook.') |
117 | 32 | 34 | ||
118 | @@ -36,35 +38,48 @@ | |||
119 | 36 | 'auth_supported': utils.config_get('auth-supported'), | 38 | 'auth_supported': utils.config_get('auth-supported'), |
120 | 37 | 'mon_hosts': ' '.join(get_mon_hosts()), | 39 | 'mon_hosts': ' '.join(get_mon_hosts()), |
121 | 38 | 'fsid': utils.config_get('fsid'), | 40 | 'fsid': utils.config_get('fsid'), |
122 | 41 | 'version': ceph.get_ceph_version() | ||
123 | 39 | } | 42 | } |
124 | 40 | 43 | ||
125 | 41 | with open('/etc/ceph/ceph.conf', 'w') as cephconf: | 44 | with open('/etc/ceph/ceph.conf', 'w') as cephconf: |
126 | 42 | cephconf.write(utils.render_template('ceph.conf', cephcontext)) | 45 | cephconf.write(utils.render_template('ceph.conf', cephcontext)) |
127 | 43 | 46 | ||
128 | 47 | JOURNAL_ZAPPED = '/var/lib/ceph/journal_zapped' | ||
129 | 48 | |||
130 | 44 | 49 | ||
131 | 45 | def config_changed(): | 50 | def config_changed(): |
132 | 46 | utils.juju_log('INFO', 'Begin config-changed hook.') | 51 | utils.juju_log('INFO', 'Begin config-changed hook.') |
133 | 47 | 52 | ||
134 | 48 | utils.juju_log('INFO', 'Monitor hosts are ' + repr(get_mon_hosts())) | 53 | utils.juju_log('INFO', 'Monitor hosts are ' + repr(get_mon_hosts())) |
135 | 49 | 54 | ||
138 | 50 | fsid = utils.config_get('fsid') | 55 | # Pre-flight checks |
139 | 51 | if fsid == '': | 56 | if not utils.config_get('fsid'): |
140 | 52 | utils.juju_log('CRITICAL', 'No fsid supplied, cannot proceed.') | 57 | utils.juju_log('CRITICAL', 'No fsid supplied, cannot proceed.') |
141 | 53 | sys.exit(1) | 58 | sys.exit(1) |
145 | 54 | 59 | if not utils.config_get('monitor-secret'): | |
143 | 55 | monitor_secret = utils.config_get('monitor-secret') | ||
144 | 56 | if monitor_secret == '': | ||
146 | 57 | utils.juju_log('CRITICAL', | 60 | utils.juju_log('CRITICAL', |
147 | 58 | 'No monitor-secret supplied, cannot proceed.') | 61 | 'No monitor-secret supplied, cannot proceed.') |
148 | 59 | sys.exit(1) | 62 | sys.exit(1) |
149 | 63 | if utils.config_get('osd-format') not in ceph.DISK_FORMATS: | ||
150 | 64 | utils.juju_log('CRITICAL', | ||
151 | 65 | 'Invalid OSD disk format configuration specified') | ||
152 | 66 | sys.exit(1) | ||
153 | 60 | 67 | ||
154 | 61 | emit_cephconf() | 68 | emit_cephconf() |
155 | 62 | 69 | ||
156 | 63 | e_mountpoint = utils.config_get('ephemeral-unmount') | 70 | e_mountpoint = utils.config_get('ephemeral-unmount') |
158 | 64 | if (e_mountpoint != "" and | 71 | if (e_mountpoint and |
159 | 65 | filesystem_mounted(e_mountpoint)): | 72 | filesystem_mounted(e_mountpoint)): |
160 | 66 | subprocess.call(['umount', e_mountpoint]) | 73 | subprocess.call(['umount', e_mountpoint]) |
161 | 67 | 74 | ||
162 | 75 | osd_journal = utils.config_get('osd-journal') | ||
163 | 76 | if (osd_journal and | ||
164 | 77 | not os.path.exists(JOURNAL_ZAPPED) and | ||
165 | 78 | os.path.exists(osd_journal)): | ||
166 | 79 | ceph.zap_disk(osd_journal) | ||
167 | 80 | with open(JOURNAL_ZAPPED, 'w') as zapped: | ||
168 | 81 | zapped.write('DONE') | ||
169 | 82 | |||
170 | 68 | for dev in utils.config_get('osd-devices').split(' '): | 83 | for dev in utils.config_get('osd-devices').split(' '): |
171 | 69 | osdize(dev) | 84 | osdize(dev) |
172 | 70 | 85 | ||
173 | @@ -96,9 +111,22 @@ | |||
174 | 96 | return hosts | 111 | return hosts |
175 | 97 | 112 | ||
176 | 98 | 113 | ||
177 | 114 | def update_monfs(): | ||
178 | 115 | hostname = utils.get_unit_hostname() | ||
179 | 116 | monfs = '/var/lib/ceph/mon/ceph-{}'.format(hostname) | ||
180 | 117 | upstart = '{}/upstart'.format(monfs) | ||
181 | 118 | if (os.path.exists(monfs) and | ||
182 | 119 | not os.path.exists(upstart)): | ||
183 | 120 | # Mark mon as managed by upstart so that | ||
184 | 121 | # it gets start correctly on reboots | ||
185 | 122 | with open(upstart, 'w'): | ||
186 | 123 | pass | ||
187 | 124 | |||
188 | 125 | |||
189 | 99 | def bootstrap_monitor_cluster(): | 126 | def bootstrap_monitor_cluster(): |
190 | 100 | hostname = utils.get_unit_hostname() | 127 | hostname = utils.get_unit_hostname() |
191 | 101 | done = '/var/lib/ceph/mon/ceph-{}/done'.format(hostname) | 128 | done = '/var/lib/ceph/mon/ceph-{}/done'.format(hostname) |
192 | 129 | upstart = '/var/lib/ceph/mon/ceph-{}/upstart'.format(hostname) | ||
193 | 102 | secret = utils.config_get('monitor-secret') | 130 | secret = utils.config_get('monitor-secret') |
194 | 103 | keyring = '/var/lib/ceph/tmp/{}.mon.keyring'.format(hostname) | 131 | keyring = '/var/lib/ceph/tmp/{}.mon.keyring'.format(hostname) |
195 | 104 | 132 | ||
196 | @@ -118,6 +146,8 @@ | |||
197 | 118 | 146 | ||
198 | 119 | with open(done, 'w'): | 147 | with open(done, 'w'): |
199 | 120 | pass | 148 | pass |
200 | 149 | with open(upstart, 'w'): | ||
201 | 150 | pass | ||
202 | 121 | 151 | ||
203 | 122 | subprocess.check_call(['start', 'ceph-mon-all-starter']) | 152 | subprocess.check_call(['start', 'ceph-mon-all-starter']) |
204 | 123 | except: | 153 | except: |
205 | @@ -127,7 +157,7 @@ | |||
206 | 127 | 157 | ||
207 | 128 | 158 | ||
208 | 129 | def reformat_osd(): | 159 | def reformat_osd(): |
210 | 130 | if utils.config_get('osd-reformat') != "": | 160 | if utils.config_get('osd-reformat'): |
211 | 131 | return True | 161 | return True |
212 | 132 | else: | 162 | else: |
213 | 133 | return False | 163 | return False |
214 | @@ -151,7 +181,23 @@ | |||
215 | 151 | 'Looks like {} is in use, skipping.'.format(dev)) | 181 | 'Looks like {} is in use, skipping.'.format(dev)) |
216 | 152 | return | 182 | return |
217 | 153 | 183 | ||
219 | 154 | subprocess.call(['ceph-disk-prepare', dev]) | 184 | cmd = ['ceph-disk-prepare'] |
220 | 185 | # Later versions of ceph support more options | ||
221 | 186 | if ceph.get_ceph_version() >= "0.55": | ||
222 | 187 | osd_format = utils.config_get('osd-format') | ||
223 | 188 | if osd_format: | ||
224 | 189 | cmd.append('--fs-type') | ||
225 | 190 | cmd.append(osd_format) | ||
226 | 191 | cmd.append(dev) | ||
227 | 192 | osd_journal = utils.config_get('osd-journal') | ||
228 | 193 | if (osd_journal and | ||
229 | 194 | os.path.exists(osd_journal)): | ||
230 | 195 | cmd.append(osd_journal) | ||
231 | 196 | else: | ||
232 | 197 | # Just provide the device - no other options | ||
233 | 198 | # for older versions of ceph | ||
234 | 199 | cmd.append(dev) | ||
235 | 200 | subprocess.call(cmd) | ||
236 | 155 | 201 | ||
237 | 156 | 202 | ||
238 | 157 | def device_mounted(dev): | 203 | def device_mounted(dev): |
239 | @@ -272,6 +318,7 @@ | |||
240 | 272 | utils.juju_log('INFO', 'Begin upgrade-charm hook.') | 318 | utils.juju_log('INFO', 'Begin upgrade-charm hook.') |
241 | 273 | emit_cephconf() | 319 | emit_cephconf() |
242 | 274 | install_upstart_scripts() | 320 | install_upstart_scripts() |
243 | 321 | update_monfs() | ||
244 | 275 | utils.juju_log('INFO', 'End upgrade-charm hook.') | 322 | utils.juju_log('INFO', 'End upgrade-charm hook.') |
245 | 276 | 323 | ||
246 | 277 | 324 | ||
247 | 278 | 325 | ||
248 | === modified file 'hooks/utils.py' | |||
249 | --- hooks/utils.py 2012-11-12 09:32:06 +0000 | |||
250 | +++ hooks/utils.py 2013-02-07 16:02:24 +0000 | |||
251 | @@ -11,16 +11,19 @@ | |||
252 | 11 | import subprocess | 11 | import subprocess |
253 | 12 | import socket | 12 | import socket |
254 | 13 | import sys | 13 | import sys |
255 | 14 | import re | ||
256 | 14 | 15 | ||
257 | 15 | 16 | ||
258 | 16 | def do_hooks(hooks): | 17 | def do_hooks(hooks): |
259 | 17 | hook = os.path.basename(sys.argv[0]) | 18 | hook = os.path.basename(sys.argv[0]) |
260 | 18 | 19 | ||
261 | 19 | try: | 20 | try: |
263 | 20 | hooks[hook]() | 21 | hook_func = hooks[hook] |
264 | 21 | except KeyError: | 22 | except KeyError: |
265 | 22 | juju_log('INFO', | 23 | juju_log('INFO', |
266 | 23 | "This charm doesn't know how to handle '{}'.".format(hook)) | 24 | "This charm doesn't know how to handle '{}'.".format(hook)) |
267 | 25 | else: | ||
268 | 26 | hook_func() | ||
269 | 24 | 27 | ||
270 | 25 | 28 | ||
271 | 26 | def install(*pkgs): | 29 | def install(*pkgs): |
272 | @@ -41,6 +44,12 @@ | |||
273 | 41 | install('python-jinja2') | 44 | install('python-jinja2') |
274 | 42 | import jinja2 | 45 | import jinja2 |
275 | 43 | 46 | ||
276 | 47 | try: | ||
277 | 48 | import dns.resolver | ||
278 | 49 | except ImportError: | ||
279 | 50 | install('python-dnspython') | ||
280 | 51 | import dns.resolver | ||
281 | 52 | |||
282 | 44 | 53 | ||
283 | 45 | def render_template(template_name, context, template_dir=TEMPLATES_DIR): | 54 | def render_template(template_name, context, template_dir=TEMPLATES_DIR): |
284 | 46 | templates = jinja2.Environment( | 55 | templates = jinja2.Environment( |
285 | @@ -88,6 +97,18 @@ | |||
286 | 88 | ] | 97 | ] |
287 | 89 | subprocess.check_call(cmd) | 98 | subprocess.check_call(cmd) |
288 | 90 | 99 | ||
289 | 100 | |||
290 | 101 | def enable_pocket(pocket): | ||
291 | 102 | apt_sources = "/etc/apt/sources.list" | ||
292 | 103 | with open(apt_sources, "r") as sources: | ||
293 | 104 | lines = sources.readlines() | ||
294 | 105 | with open(apt_sources, "w") as sources: | ||
295 | 106 | for line in lines: | ||
296 | 107 | if pocket in line: | ||
297 | 108 | sources.write(re.sub('^# deb', 'deb', line)) | ||
298 | 109 | else: | ||
299 | 110 | sources.write(line) | ||
300 | 111 | |||
301 | 91 | # Protocols | 112 | # Protocols |
302 | 92 | TCP = 'TCP' | 113 | TCP = 'TCP' |
303 | 93 | UDP = 'UDP' | 114 | UDP = 'UDP' |
304 | @@ -136,7 +157,11 @@ | |||
305 | 136 | cmd.append(attribute) | 157 | cmd.append(attribute) |
306 | 137 | if unit: | 158 | if unit: |
307 | 138 | cmd.append(unit) | 159 | cmd.append(unit) |
309 | 139 | return subprocess.check_output(cmd).strip() # IGNORE:E1103 | 160 | value = str(subprocess.check_output(cmd)).strip() |
310 | 161 | if value == "": | ||
311 | 162 | return None | ||
312 | 163 | else: | ||
313 | 164 | return value | ||
314 | 140 | 165 | ||
315 | 141 | 166 | ||
316 | 142 | def relation_set(**kwargs): | 167 | def relation_set(**kwargs): |
317 | @@ -159,7 +184,11 @@ | |||
318 | 159 | 'unit-get', | 184 | 'unit-get', |
319 | 160 | attribute | 185 | attribute |
320 | 161 | ] | 186 | ] |
322 | 162 | return subprocess.check_output(cmd).strip() # IGNORE:E1103 | 187 | value = str(subprocess.check_output(cmd)).strip() |
323 | 188 | if value == "": | ||
324 | 189 | return None | ||
325 | 190 | else: | ||
326 | 191 | return value | ||
327 | 163 | 192 | ||
328 | 164 | 193 | ||
329 | 165 | def config_get(attribute): | 194 | def config_get(attribute): |
330 | @@ -167,7 +196,11 @@ | |||
331 | 167 | 'config-get', | 196 | 'config-get', |
332 | 168 | attribute | 197 | attribute |
333 | 169 | ] | 198 | ] |
335 | 170 | return subprocess.check_output(cmd).strip() # IGNORE:E1103 | 199 | value = str(subprocess.check_output(cmd)).strip() |
336 | 200 | if value == "": | ||
337 | 201 | return None | ||
338 | 202 | else: | ||
339 | 203 | return value | ||
340 | 171 | 204 | ||
341 | 172 | 205 | ||
342 | 173 | def get_unit_hostname(): | 206 | def get_unit_hostname(): |
343 | @@ -175,9 +208,13 @@ | |||
344 | 175 | 208 | ||
345 | 176 | 209 | ||
346 | 177 | def get_host_ip(hostname=unit_get('private-address')): | 210 | def get_host_ip(hostname=unit_get('private-address')): |
353 | 178 | cmd = [ | 211 | try: |
354 | 179 | 'dig', | 212 | # Test to see if already an IPv4 address |
355 | 180 | '+short', | 213 | socket.inet_aton(hostname) |
356 | 181 | hostname | 214 | return hostname |
357 | 182 | ] | 215 | except socket.error: |
358 | 183 | return subprocess.check_output(cmd).strip() # IGNORE:E1103 | 216 | # This may throw an NXDOMAIN exception; in which case |
359 | 217 | # things are badly broken so just let it kill the hook | ||
360 | 218 | answers = dns.resolver.query(hostname, 'A') | ||
361 | 219 | if answers: | ||
362 | 220 | return answers[0].address | ||
363 | 184 | 221 | ||
364 | === modified file 'revision' | |||
365 | --- revision 2012-11-12 10:00:27 +0000 | |||
366 | +++ revision 2013-02-07 16:02:24 +0000 | |||
367 | @@ -1,1 +1,1 @@ | |||
369 | 1 | 88 | 1 | 91 |
370 | 2 | 2 | ||
371 | === modified file 'templates/ceph.conf' | |||
372 | --- templates/ceph.conf 2012-10-18 06:19:52 +0000 | |||
373 | +++ templates/ceph.conf 2013-02-07 16:02:24 +0000 | |||
374 | @@ -1,5 +1,11 @@ | |||
375 | 1 | [global] | 1 | [global] |
376 | 2 | {% if version < "0.51" %} | ||
377 | 2 | auth supported = {{ auth_supported }} | 3 | auth supported = {{ auth_supported }} |
378 | 4 | {% else %} | ||
379 | 5 | auth cluster required = {{ auth_supported }} | ||
380 | 6 | auth service required = {{ auth_supported }} | ||
381 | 7 | auth client required = {{ auth_supported }} | ||
382 | 8 | {% endif %} | ||
383 | 3 | keyring = /etc/ceph/$cluster.$name.keyring | 9 | keyring = /etc/ceph/$cluster.$name.keyring |
384 | 4 | mon host = {{ mon_hosts }} | 10 | mon host = {{ mon_hosts }} |
385 | 5 | fsid = {{ fsid }} | 11 | fsid = {{ fsid }} |
My only concern is that in the function get_mon_hosts, it is possible that NXDOMAIN (which certainly seems could potentially happen) will result in None:6789 as one of the items in the hosts list:
This list is then passed on to ceph via /etc/ceph/ ceph.conf, so this may be fine. But it also seems potentially problematic.
Maybe instead we should simply not append an unresolved address to hosts. Another possibility is to do a retry on get_host_ip. Alternatively instead of swallowing the error, we could force the juju admin to resolve this problem. That does sound more painful however.