diff --git a/src/config.yaml b/src/config.yaml index a832465..2c95ed2 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -1,21 +1,18 @@ options: - vlan-ranges: + install-source: type: string - default: "physnet1:1000:2000" + default: "deb-resource" description: | - Space-delimited list of Neutron network-provider & vlan-id-ranges using - the following format ":: ...". - overlay-network-type: - default: gre + Installation source for package. Valid options are: + . + deb-resource + deb + pip + . + deb-resource means the debian package as a provided resource. + deb is package provided by an official (or preconfigured) repository. + pip is installation directly from pip. + deb-package-name: type: string - description: | - Overlay network types to use, valid options include: - . - gre - vxlan - . - Multiple types can be provided - field is space delimited. - security-groups: - default: false - type: boolean - description: Enable OpenDayLight managed security groups. + default: "networking-generic-switch" + description: Debian package name. For installation with "deb" install source. diff --git a/src/lib/charm/openstack/neutron_api_genericswitch.py b/src/lib/charm/openstack/neutron_api_genericswitch.py index 35fa1aa..a7f09f2 100644 --- a/src/lib/charm/openstack/neutron_api_genericswitch.py +++ b/src/lib/charm/openstack/neutron_api_genericswitch.py @@ -15,7 +15,8 @@ import charms_openstack.adapters import charms_openstack.charm import charmhelpers.contrib.openstack.utils as ch_utils - +from charmhelpers.core import hookenv +from charmhelpers.core.hookenv import config ML2_CONF = '/etc/neutron/plugins/ml2/ml2_conf.ini' VLAN = 'vlan' @@ -45,10 +46,7 @@ class NewtonNeutronAPIGenericSwitchCharm(charms_openstack.charm.OpenStackCharm): release = 'newton' - packages = ['neutron-common', - 'neutron-plugin-ml2', - 'nginx-light', - ] + packages = [] required_relations = ['neutron-plugin-api-subordinate'] restart_map = {ML2_CONF: []} @@ -60,6 +58,18 @@ class NewtonNeutronAPIGenericSwitchCharm(charms_openstack.charm.OpenStackCharm): 'neutron_lbaas.services.loadbalancer.' 'plugin.LoadBalancerPluginv2') + def install(self): + # TODO(mmitchell): support modes other than deb-resource. + if config('install-source') == 'deb-resource': + hookenv.log('Installing deb from resource file.') + package_path = hookenv.resource_get(name='package') + + # NOTE(mmitchell): This puts the full package path as a package to install. + # Should be enough to get to the point where apt will install it. + self.packages = [package_path] + + super().install() + def configure_plugin(self, api_principle): """Add sections and tuples to insert values into neutron-server's neutron.conf diff --git a/src/metadata.yaml b/src/metadata.yaml index f5aec1a..b90ea29 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -26,3 +26,8 @@ requires: container: interface: juju-info scope: container +resources: + package: + type: file + filename: neutron-api-genericswitch.deb + description: Packaged version of the networking-generic-switch python package