Added cephx support

This commit is contained in:
James Page 2012-10-09 13:35:06 +01:00
parent b183a9d41f
commit 632bb6015c
5 changed files with 19 additions and 9 deletions

8
README
View File

@ -30,9 +30,13 @@ The gateway can be accessed over port 80 (as show in juju status exposed
ports).
Note that you will need to login to one of the service units supporting the
ceph-radosgw charm to generate some access credentials::
ceph charm to generate some access credentials::
radosgw-admin user create --uid="ubuntu" --display-name="Ubuntu Ceph"
juju ssh ceph/0 \
'sudo radosgw-admin user create --uid="ubuntu" --display-name="Ubuntu Ceph"'
For security reasons the ceph-radosgw charm is not setup with appropriate
permissions to administer the ceph cluster.
Scale-out
=========

1
TODO
View File

@ -1,5 +1,4 @@
RADOS Gateway Charm
-------------------
* cephx support
* Improved process control of radosgw daemon (to many restarts)

View File

@ -12,6 +12,7 @@ import subprocess
import sys
import glob
import os
import ceph
import utils
@ -99,7 +100,10 @@ def get_mon_hosts():
def mon_relation():
utils.juju_log('INFO', 'Begin mon-relation hook.')
emit_cephconf()
restart()
key = utils.relation_get('radosgw_key')
if key != "":
ceph.import_radosgw_key(key)
restart() # TODO figure out a better way todo this
utils.juju_log('INFO', 'End mon-relation hook.')
@ -116,14 +120,18 @@ def upgrade_charm():
def start():
# In case we're being redeployed to the same machines, try
# to make sure everything is running as soon as possible.
subprocess.call(['service', 'radosgw', 'start'])
utils.expose(port=80)
def stop():
subprocess.call(['service', 'radosgw', 'start'])
utils.expose(port=80)
def restart():
subprocess.call(['service', 'radosgw', 'restart'])
utils.expose(port=80)
utils.do_hooks({
@ -132,7 +140,6 @@ utils.do_hooks({
'mon-relation-departed': mon_relation,
'mon-relation-changed': mon_relation,
'gateway-relation-joined': gateway_relation,
'start': start,
'upgrade-charm': config_changed, # same function ATM
})

View File

@ -1 +1 @@
11
14

View File

@ -1,5 +1,5 @@
[global]
auth supported = none
auth supported = cephx
mon host = {{ mon_hosts }}
[client.radosgw.gateway]