def notify_radosgws(): utils.juju_log('INFO', 'Begin notify_radosgws.') for relid in utils.relation_ids('radosgw'): utils.relation_set(radosgw_key=ceph.get_radosgw_key(), auth=utils.config_get('auth-supported'), rid=relid) utils.juju_log('INFO', 'End notify_radosgws.')
def notify_client(): utils.juju_log('INFO', 'Begin notify_client.') for relid in utils.relation_ids('client'): service_name = utils.relation_list(relid)[0].split('/')[0] utils.relation_set(key=ceph.get_named_key(service_name), auth=utils.config_get('auth-supported'), rid=relid) utils.juju_log('INFO', 'End notify_client.')
def notify_osds(): utils.juju_log('INFO', 'Begin notify_osds.') for relid in utils.relation_ids('osd'): utils.relation_set(fsid=utils.config_get('fsid'), osd_bootstrap_key=ceph.get_osd_bootstrap_key(), auth=utils.config_get('auth-supported'), rid=relid) utils.juju_log('INFO', 'End notify_osds.')
def osd_relation(): utils.juju_log('INFO', 'Begin osd-relation hook.') if ceph.is_quorum(): utils.juju_log('INFO', 'mon cluster in quorum - providing fsid & keys') utils.relation_set(fsid=utils.config_get('fsid'), osd_bootstrap_key=ceph.get_osd_bootstrap_key(), auth=utils.config_get('auth-supported')) else: utils.juju_log('INFO', 'mon cluster not in quorum - deferring fsid provision') utils.juju_log('INFO', 'End osd-relation hook.')
def identity_joined(relid=None): if ceph.get_ceph_version('radosgw') < "0.55": utils.juju_log('ERROR', 'Integration with keystone requires ceph >= 0.55') sys.exit(1) hostname = utils.unit_get('private-address') admin_url = 'http://{}:80/swift'.format(hostname) internal_url = public_url = '{}/v1'.format(admin_url) utils.relation_set(service='swift', region=utils.config_get('region'), public_url=public_url, internal_url=internal_url, admin_url=admin_url, requested_roles=utils.config_get('operator-roles'), rid=relid)
def client_relation(): utils.juju_log('INFO', 'Begin client-relation hook.') if ceph.is_quorum(): utils.juju_log('INFO', 'mon cluster in quorum - \ providing client with keys') service_name = os.environ['JUJU_REMOTE_UNIT'].split('/')[0] utils.relation_set(key=ceph.get_named_key(service_name), auth=utils.config_get('auth-supported')) else: utils.juju_log('INFO', 'mon cluster not in quorum - deferring key provision') utils.juju_log('INFO', 'End client-relation hook.')
def radosgw_relation(): utils.juju_log('INFO', 'Begin radosgw-relation hook.') utils.install('radosgw') # Install radosgw for admin tools if ceph.is_quorum(): utils.juju_log('INFO', 'mon cluster in quorum - \ providing radosgw with keys') utils.relation_set(radosgw_key=ceph.get_radosgw_key(), auth=utils.config_get('auth-supported')) else: utils.juju_log('INFO', 'mon cluster not in quorum - deferring key provision') utils.juju_log('INFO', 'End radosgw-relation hook.')
def gateway_relation(): utils.juju_log('INFO', 'Begin gateway-relation hook.') utils.relation_set(hostname=utils.unit_get('private-address'), port=80) utils.juju_log('INFO', 'Begin gateway-relation hook.')
def head_hook(): relation_set(datasource="true") configure_gmond()
def website_hook(): relation_set(port=80) relation_set(hostname=unit_get("private-address"))
def node_joined_hook(): relation_set(service=get_principle_name().split('/')[0])