Add Admin Relation
OpenAttic is a manager for Ceph and requires access to the cephx admin keyring. This relation can be used by any Ceph management software that needs the admin key. Change-Id: Ied73e775bdf58f226f9b7ffcc6353ed1be3ec245
This commit is contained in:
parent
1287b0c9c6
commit
4bdb0174fd
1
hooks/admin-relation-changed
Symbolic link
1
hooks/admin-relation-changed
Symbolic link
@ -0,0 +1 @@
|
||||
ceph_hooks.py
|
1
hooks/admin-relation-joined
Symbolic link
1
hooks/admin-relation-joined
Symbolic link
@ -0,0 +1 @@
|
||||
ceph_hooks.py
|
@ -488,6 +488,8 @@ def notify_radosgws():
|
||||
def notify_client():
|
||||
for relid in relation_ids('client'):
|
||||
client_relation_joined(relid)
|
||||
for relid in relation_ids('admin'):
|
||||
admin_relation_joined(relid)
|
||||
|
||||
|
||||
def upgrade_keys():
|
||||
@ -576,6 +578,22 @@ def radosgw_relation(relid=None, unit=None):
|
||||
log('mon cluster not in quorum or no osds - deferring key provision')
|
||||
|
||||
|
||||
@hooks.hook('admin-relation-changed')
|
||||
@hooks.hook('admin-relation-joined')
|
||||
def admin_relation_joined(relid=None):
|
||||
if ceph.is_quorum():
|
||||
log('mon cluster in quorum - providing client with keys')
|
||||
data = {'key': ceph.get_named_key(name='admin', caps=ceph.admin_caps),
|
||||
'fsid': leader_get('fsid'),
|
||||
'auth': config('auth-supported'),
|
||||
'mon_hosts': " ".join(get_mon_hosts())
|
||||
}
|
||||
relation_set(relation_id=relid,
|
||||
relation_settings=data)
|
||||
else:
|
||||
log('mon cluster not in quorum - deferring key provision')
|
||||
|
||||
|
||||
@hooks.hook('client-relation-joined')
|
||||
def client_relation_joined(relid=None):
|
||||
if ceph.is_quorum():
|
||||
|
@ -931,7 +931,7 @@ _default_caps = {
|
||||
}
|
||||
|
||||
admin_caps = {
|
||||
'mds': ['allow'],
|
||||
'mds': ['allow *'],
|
||||
'mon': ['allow *'],
|
||||
'osd': ['allow *']
|
||||
}
|
||||
|
@ -19,6 +19,8 @@ provides:
|
||||
nrpe-external-master:
|
||||
interface: nrpe-external-master
|
||||
scope: container
|
||||
admin:
|
||||
interface: ceph-admin
|
||||
client:
|
||||
interface: ceph-client
|
||||
osd:
|
||||
|
Loading…
Reference in New Issue
Block a user