Add extra admin-network configuration

This commit is contained in:
James Page 2014-06-27 11:37:18 +01:00
parent c25bd9dedf
commit 6dac953777
3 changed files with 28 additions and 8 deletions

View File

@ -167,13 +167,20 @@ options:
# end of NVP/NSX configuration # end of NVP/NSX configuration
# Network configuration options # Network configuration options
# by default all access is over 'private-address' # by default all access is over 'private-address'
os-admin-network:
type: string
description: |
The IP address and netmask of the OpenStack Admin network (e.g.,
192.168.0.0/24)
.
This network will be used for admin endpoints.
os-internal-network: os-internal-network:
type: string type: string
description: | description: |
The IP address and netmask of the OpenStack Internal network (e.g., The IP address and netmask of the OpenStack Internal network (e.g.,
192.168.0.0/24) 192.168.0.0/24)
. .
This network will be used for admin and internal endpoints. This network will be used for internal endpoints.
os-public-network: os-public-network:
type: string type: string
description: | description: |

View File

@ -239,8 +239,12 @@ def identity_joined(rid=None):
internal_url = canonical_url(CONFIGS, internal_url = canonical_url(CONFIGS,
address=get_address_in_network(config('os-internal-network'), address=get_address_in_network(config('os-internal-network'),
unit_get('private-address'))) unit_get('private-address')))
admin_url = canonical_url(CONFIGS,
address=get_address_in_network(config('os-admin-network'),
unit_get('private-address')))
relation_set(relation_id=rid, **determine_endpoints(public_url, relation_set(relation_id=rid, **determine_endpoints(public_url,
internal_url)) internal_url,
admin_url))
@hooks.hook('identity-service-relation-changed') @hooks.hook('identity-service-relation-changed')

View File

@ -643,7 +643,7 @@ def ssh_compute_remove(public_key, user=None):
_keys.write(keys) _keys.write(keys)
def determine_endpoints(public_url, internal_url): def determine_endpoints(public_url, internal_url, admin_url):
'''Generates a dictionary containing all relevant endpoints to be '''Generates a dictionary containing all relevant endpoints to be
passed to keystone as relation settings.''' passed to keystone as relation settings.'''
region = config('region') region = config('region')
@ -654,42 +654,51 @@ def determine_endpoints(public_url, internal_url):
(public_url, api_port('nova-api-os-compute'))) (public_url, api_port('nova-api-os-compute')))
nova_internal_url = ('%s:%s/v2/$(tenant_id)s' % nova_internal_url = ('%s:%s/v2/$(tenant_id)s' %
(internal_url, api_port('nova-api-os-compute'))) (internal_url, api_port('nova-api-os-compute')))
nova_admin_url = ('%s:%s/v2/$(tenant_id)s' %
(admin_url, api_port('nova-api-os-compute')))
else: else:
nova_public_url = ('%s:%s/v1.1/$(tenant_id)s' % nova_public_url = ('%s:%s/v1.1/$(tenant_id)s' %
(public_url, api_port('nova-api-os-compute'))) (public_url, api_port('nova-api-os-compute')))
nova_internal_url = ('%s:%s/v1.1/$(tenant_id)s' % nova_internal_url = ('%s:%s/v1.1/$(tenant_id)s' %
(internal_url, api_port('nova-api-os-compute'))) (internal_url, api_port('nova-api-os-compute')))
nova_admin_url = ('%s:%s/v1.1/$(tenant_id)s' %
(admin_url, api_port('nova-api-os-compute')))
ec2_public_url = '%s:%s/services/Cloud' % (public_url, api_port('nova-api-ec2')) ec2_public_url = '%s:%s/services/Cloud' % (public_url, api_port('nova-api-ec2'))
ec2_internal_url = '%s:%s/services/Cloud' % (internal_url, api_port('nova-api-ec2')) ec2_internal_url = '%s:%s/services/Cloud' % (internal_url, api_port('nova-api-ec2'))
ec2_admin_url = '%s:%s/services/Cloud' % (admin_url, api_port('nova-api-ec2'))
nova_volume_public_url = ('%s:%s/v1/$(tenant_id)s' % nova_volume_public_url = ('%s:%s/v1/$(tenant_id)s' %
(public_url, api_port('nova-api-os-compute'))) (public_url, api_port('nova-api-os-compute')))
nova_volume_internal_url = ('%s:%s/v1/$(tenant_id)s' % nova_volume_internal_url = ('%s:%s/v1/$(tenant_id)s' %
(internal_url, api_port('nova-api-os-compute'))) (internal_url, api_port('nova-api-os-compute')))
nova_volume_admin_url = ('%s:%s/v1/$(tenant_id)s' %
(admin_url, api_port('nova-api-os-compute')))
neutron_public_url = '%s:%s' % (public_url, api_port('neutron-server')) neutron_public_url = '%s:%s' % (public_url, api_port('neutron-server'))
neutron_internal_url = '%s:%s' % (internal_url, api_port('neutron-server')) neutron_internal_url = '%s:%s' % (internal_url, api_port('neutron-server'))
neutron_admin_url = '%s:%s' % (admin_url, api_port('neutron-server'))
s3_public_url = '%s:%s' % (public_url, api_port('nova-objectstore')) s3_public_url = '%s:%s' % (public_url, api_port('nova-objectstore'))
s3_internal_url = '%s:%s' % (internal_url, api_port('nova-objectstore')) s3_internal_url = '%s:%s' % (internal_url, api_port('nova-objectstore'))
s3_admin_url = '%s:%s' % (admin_url, api_port('nova-objectstore'))
# the base endpoints # the base endpoints
endpoints = { endpoints = {
'nova_service': 'nova', 'nova_service': 'nova',
'nova_region': region, 'nova_region': region,
'nova_public_url': nova_public_url, 'nova_public_url': nova_public_url,
'nova_admin_url': nova_internal_url, 'nova_admin_url': nova_admin_url,
'nova_internal_url': nova_internal_url, 'nova_internal_url': nova_internal_url,
'ec2_service': 'ec2', 'ec2_service': 'ec2',
'ec2_region': region, 'ec2_region': region,
'ec2_public_url': ec2_public_url, 'ec2_public_url': ec2_public_url,
'ec2_admin_url': ec2_internal_url, 'ec2_admin_url': ec2_admin_url,
'ec2_internal_url': ec2_internal_url, 'ec2_internal_url': ec2_internal_url,
's3_service': 's3', 's3_service': 's3',
's3_region': region, 's3_region': region,
's3_public_url': s3_public_url, 's3_public_url': s3_public_url,
's3_admin_url': s3_internal_url, 's3_admin_url': s3_admin_url,
's3_internal_url': s3_internal_url, 's3_internal_url': s3_internal_url,
} }
@ -698,7 +707,7 @@ def determine_endpoints(public_url, internal_url):
'nova-volume_service': 'nova-volume', 'nova-volume_service': 'nova-volume',
'nova-volume_region': region, 'nova-volume_region': region,
'nova-volume_public_url': nova_volume_public_url, 'nova-volume_public_url': nova_volume_public_url,
'nova-volume_admin_url': nova_volume_internal_url, 'nova-volume_admin_url': nova_volume_admin_url,
'nova-volume_internal_url': nova_volume_internal_url, 'nova-volume_internal_url': nova_volume_internal_url,
}) })
@ -716,7 +725,7 @@ def determine_endpoints(public_url, internal_url):
'quantum_service': 'quantum', 'quantum_service': 'quantum',
'quantum_region': region, 'quantum_region': region,
'quantum_public_url': neutron_public_url, 'quantum_public_url': neutron_public_url,
'quantum_admin_url': neutron_internal_url, 'quantum_admin_url': neutron_admin_url,
'quantum_internal_url': neutron_internal_url, 'quantum_internal_url': neutron_internal_url,
}) })