515
515
apt_install(packages=filter_installed_packages(['radosgw']))
517
517
unit = remote_unit()
518
"""Process broker request(s)."""
519
519
if ceph.is_quorum():
520
log('mon cluster in quorum - providing radosgw with keys')
521
public_addr = get_public_addr()
523
'fsid': leader_get('fsid'),
524
'radosgw_key': ceph.get_radosgw_key(),
525
'auth': config('auth-supported'),
526
'ceph-public-address': public_addr,
520
529
settings = relation_get(rid=relid, unit=unit)
530
"""Process broker request(s)."""
521
531
if 'broker_req' in settings:
522
if not ceph.is_leader():
523
log("Not leader - ignoring broker request", level=DEBUG)
525
533
rsp = process_requests(settings['broker_req'])
526
534
unit_id = unit.replace('/', '-')
527
535
unit_response_key = 'broker-rsp-' + unit_id
528
log('mon cluster in quorum - providing radosgw with keys')
529
public_addr = get_public_addr()
531
'fsid': leader_get('fsid'),
532
'radosgw_key': ceph.get_radosgw_key(),
533
'auth': config('auth-supported'),
534
'ceph-public-address': public_addr,
535
unit_response_key: rsp,
537
relation_set(relation_id=relid, relation_settings=data)
536
data[unit_response_key] = rsp
538
log("Not leader - ignoring broker request", level=DEBUG)
540
relation_set(relation_id=relid, relation_settings=data)
539
542
log('mon cluster not in quorum - deferring key provision')