示例#1
0
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.')
示例#2
0
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.')
示例#3
0
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.')
示例#4
0
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.')
示例#5
0
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)
示例#6
0
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.')
示例#7
0
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)
示例#8
0
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.')
示例#9
0
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.')
示例#10
0
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.')
示例#11
0
def head_hook():
    relation_set(datasource="true")
    configure_gmond()
示例#12
0
def website_hook():
    relation_set(port=80)
    relation_set(hostname=unit_get("private-address"))
示例#13
0
def node_joined_hook():
    relation_set(service=get_principle_name().split('/')[0])