director provides a new relations for pg-vip etc

This commit is contained in:
Junaid Ali 2016-05-04 02:47:43 -04:00
parent 1af750f3af
commit bd16adb21c
3 changed files with 29 additions and 0 deletions

View File

@ -3,6 +3,14 @@ options:
default: 192.168.100.250
type: string
description: IP address of the Director's Management interface. Same IP can be used to access PG Console.
plumgrid-username:
default: plumgrid
type: string
description: Username to access PLUMgrid Director
plumgrid-password:
default: plumgrid
type: string
description: Password to access PLUMgrid Director
lcm-ssh-key:
default: 'null'
type: string

View File

@ -87,6 +87,19 @@ def plumgrid_joined(relation_id=None):
relation_set(relation_id=relation_id, opsvm_ip=opsvm_ip)
@hooks.hook('plumgrid-configs-relation-joined')
def plumgrid_configs_joined(relation_id=None):
'''
This hook is run when relation with neutron-api-plumgrid is created.
'''
relation_settings = {
'plumgrid_virtual_ip': config('plumgrid-virtual-ip'),
'plumgrid_username': config('plumgrid-username'),
'plumgrid_password': config('plumgrid-password'),
}
relation_set(relation_id=relation_id, relation_settings=relation_settings)
@hooks.hook('config-changed')
def config_changed():
'''
@ -108,6 +121,12 @@ def config_changed():
if charm_config.changed('plumgrid-virtual-ip'):
CONFIGS.write_all()
stop_pg()
for rid in relation_ids('plumgrid-configs'):
plumgrid_configs_joined(rid)
if (charm_config.changed('plumgrid-username') or
charm_config.changed('plumgrid-password')):
for rid in relation_ids('plumgrid-configs'):
plumgrid_configs_joined(rid)
if (charm_config.changed('install_sources') or
charm_config.changed('plumgrid-build') or
charm_config.changed('install_keys') or

View File

@ -15,6 +15,8 @@ requires:
provides:
plumgrid:
interface: plumgrid
plumgrid-configs:
interface: plumgrid-configs
peers:
director:
interface: director