diff --git a/config.yaml b/config.yaml index d2f53d1f..562f0581 100644 --- a/config.yaml +++ b/config.yaml @@ -368,6 +368,20 @@ options: description: | A comma-separated list of nagios servicegroups. If left empty, the nagios_context will be used as the servicegroup + #PLUMgrid Plugin configuration + plumgrid-username: + default: plumgrid + type: string + description: Username + plumgrid-password: + default: plumgrid + type: string + description: Password + plumgrid-virtual-ip: + default: + type: string + description: Virtual IP to access PG Console + # end of PLUMgrid configuration manage-neutron-plugin-legacy-mode: type: boolean default: True diff --git a/hooks/charmhelpers/contrib/openstack/context.py b/hooks/charmhelpers/contrib/openstack/context.py index 9a33a035..e5feff56 100644 --- a/hooks/charmhelpers/contrib/openstack/context.py +++ b/hooks/charmhelpers/contrib/openstack/context.py @@ -880,6 +880,19 @@ class NeutronContext(OSContextGenerator): return calico_ctxt + def pg_ctxt(self): + driver = neutron_plugin_attribute(self.plugin, 'driver', + self.network_manager) + config = neutron_plugin_attribute(self.plugin, 'config', + self.network_manager) + ovs_ctxt = {'core_plugin': driver, + 'neutron_plugin': 'plumgrid', + 'neutron_security_groups': self.neutron_security_groups, + 'local_ip': unit_private_ip(), + 'config': config} + + return ovs_ctxt + def neutron_ctxt(self): if https(): proto = 'https' @@ -914,6 +927,8 @@ class NeutronContext(OSContextGenerator): ctxt.update(self.calico_ctxt()) elif self.plugin == 'vsp': ctxt.update(self.nuage_ctxt()) + elif self.plugin == 'plumgrid': + ctxt.update(self.pg_ctxt()) alchemy_flags = config('neutron-alchemy-flags') if alchemy_flags: diff --git a/hooks/charmhelpers/contrib/openstack/neutron.py b/hooks/charmhelpers/contrib/openstack/neutron.py index c3d5c28e..55b2037f 100644 --- a/hooks/charmhelpers/contrib/openstack/neutron.py +++ b/hooks/charmhelpers/contrib/openstack/neutron.py @@ -195,6 +195,20 @@ def neutron_plugins(): 'packages': [], 'server_packages': ['neutron-server', 'neutron-plugin-nuage'], 'server_services': ['neutron-server'] + }, + 'plumgrid': { + 'config': '/etc/neutron/plugins/plumgrid/plumgrid.ini', + 'driver': 'neutron.plugins.plumgrid.plumgrid_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2', + 'contexts': [ + context.SharedDBContext(user=config('database-user'), + database=config('database'), + ssl_dir=NEUTRON_CONF_DIR)], + 'services': [], + 'packages': [['plumgrid-lxc'], + ['iovisor-dkms']], + 'server_packages': ['neutron-server', + 'neutron-plugin-plumgrid'], + 'server_services': ['neutron-server'] } } if release >= 'icehouse': diff --git a/unit_tests/test_neutron_api_context.py b/unit_tests/test_neutron_api_context.py index cf4dd6b2..bf45469d 100644 --- a/unit_tests/test_neutron_api_context.py +++ b/unit_tests/test_neutron_api_context.py @@ -272,6 +272,9 @@ class NeutronCCContextTest(CharmTestCase): self.test_config.set('nsx-tz-uuid', 'tzuuid') self.test_config.set('nsx-l3-uuid', 'l3uuid') self.test_config.set('nsx-controllers', 'ctrl1 ctrl2') + self.test_config.set('plumgrid-username', 'plumgrid') + self.test_config.set('plumgrid-password', 'plumgrid') + self.test_config.set('plumgrid-virtual-ip', '192.168.100.250') def tearDown(self): super(NeutronCCContextTest, self).tearDown()