9
"ovs": [ # TODO: Assumes Quantum Provider Gateway
10
"quantum-plugin-openvswitch",
11
"quantum-plugin-openvswitch-agent",
15
"nvp": ["quantum-plugin-nicira"] # No agent required
20
utils.configure_source()
21
# TODO: when using the nicira plugin /etc/default/quantum-server
22
# will also need to be updated to point to the correct configuration
23
plugin = utils.config_get('plugin')
24
if plugin in PLUGIN_PKGS.keys():
26
# Install OVS DKMS first to ensure that the ovs module
27
# loaded supports GRE tunnels
28
utils.install('openvswitch-datapath-dkms')
29
utils.install(['quantum-server'].extend(PLUGIN_PKGS[plugin]))
31
utils.juju_log('ERROR', 'Please provide a valid plugin config')
36
plugin = utils.config_get('plugin')
37
if plugin in PLUGIN_PKGS.keys():
39
# TODO: Defaults to Quantum Provider Router
40
quantum_utils.add_bridge('br-int')
41
quantum_utils.add_bridge('br-ext')
42
ext_port = utils.config_get('ext-port')
44
quantum_utils.add_bridge_port('br-ex', ext_port)
45
quantum_utils.configure_core_plugin(plugin)
46
quantum_utils.configure_local_ip(plugin,
47
utils.unit_get('private-address'))
49
utils.juju_log('ERROR',
50
'Please provide a valid plugin config')
54
def keystone_joined():
55
url = "http://{}:9696/".format(utils.unit_get('private-address'))
56
utils.relation_set(service="quantum",
63
def keystone_changed():
64
token = utils.relation_get('admin_token')
65
service_port = utils.relation_get('service_port')
66
auth_port = utils.relation_get('auth_port')
67
service_username = utils.relation_get('service_username')
68
service_password = utils.relation_get('service_password')
69
service_tenant = utils.relation_get('service_tenant')
76
utils.juju_log('INFO',
77
'keystone peer not ready yet')
80
utils.juju_log('ERROR',
83
keystone_host = utils.relation_get('private-address')
84
utils.juju_log('INFO', 'Configuring quantum for keystone authentication')
85
quantum_utils.configure_keystone(keystone_host,
95
utils.relation_set(username=quantum_utils.DB_USER,
96
database=quantum_utils.QUANTUM_DB,
97
hostname=utils.unit_get('private-address'))
101
host = utils.relation_get('private-address')
102
password = utils.relation_get('password')
103
if not (host and password):
106
quantum_utils.configure_db_connection(utils.config_get('plugin'),
120
"config-changed": config_changed,
121
"identity-service-relation-joined": keystone_joined,
122
"identity-service-relation-changed": keystone_changed,
123
"shared-db-relation-joined": db_joined,
124
"shared-db-relation-changed": db_changed,
125
"amqp-relation-joined": amqp_joined,
126
"amqp-relation-changed": amqp_changed