. /usr/share/debconf/confmodule
N_CONF=/etc/neutron/neutron.conf
+OVS_CONF=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
#PKGOS-INCLUDE#
pkgos_var_user_group neutron
chmod 755 /var/lib/neutron
+
+# Configure the SQL connection
+pkgos_dbc_read_conf -pkg neutron-common ${OVS_CONF} DATABASE sql_connection neutron $@
+
+# Configure the keystone_authtoken
pkgos_read_admin_creds ${N_CONF} keystone_authtoken neutron
+# Select which plugin to use
pkgos_read_config -p high /etc/default/neutron-server NO_SECTION NEUTRON_plugin_path neutron/plugin-select
+# OVS specific configurations (if that's the one selected)
+if [ "${RET}" = "openvswitch/ovs_neutron_plugin.ini" ] ;
+ # Various network config...
+ pkgos_read_config ${OVS_CONF} OVS tenant_network_type neutron-plugin-openvswitch/tenant_network_type
+ pkgos_read_config ${OVS_CONF} OVS enable_tunneling neutron-plugin-openvswitch/enable_tunneling
+ pkgos_read_config ${OVS_CONF} OVS tunnel_id_ranges neutron-plugin-openvswitch/tunnel_id_ranges
+
+ # Guess values to put in the local_ip directive
+ IF=`LC_ALL=C route | grep default |awk -- '{ print $8 }'`
+ guessed_ip_addr=`LC_ALL=C ifconfig ${IF} | grep 'inet addr' | sed 's/.\+inet addr:\([0-9.]\+\).\+/\1/'`
+ if [ -z "${guessed_ip_addr}" ] ; then
+ guessed_ip_addr=`LC_ALL=C ifconfig ${IF} | grep 'inet adr' | sed 's/.\+inet adr:\([0-9.]\+\).\+/\1/'`
+ fi
+ db_set neutron-plugin-openvswitch/local_ip ${guessed_ip_addr}
+ pkgos_read_config ${OVS_CONF} OVS local_ip neutron-plugin-openvswitch/local_ip
+fi
+
exit 0
set -e
N_CONF=/etc/neutron/neutron.conf
+OVS_CONF=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
#PKGOS-INCLUDE#
install -D -m 0664 /usr/share/neutron-common/neutron-default /etc/default/neutron
fi
db_get neutron/plugin-select
+ NEUTRON_plugin_path=${RET}
if [ -n "${RET}" ] ; then
pkgos_inifile -shinc set /etc/default/neutron NO_SECTION NEUTRON_plugin_path ${RET}
fi
pkgos_write_new_conf neutron api-paste.ini
pkgos_write_new_conf neutron neutron.conf
pkgos_write_admin_creds ${N_CONF} keystone_authtoken neutron
+
+ pkgos_dbc_postinst --suite neutron ${OVS_CONF} DATABASE sql_connection neutron $@
+
+ # Maintain the OVS config
+ if [ ! -e ${OVS_CONF} ] ; then
+ install -D -m 0640 -o neutron -g neutron /usr/share/neutron-common/ovs_neutron_plugin.ini ${OVS_CONF}
+ fi
+
+ if [ "${NEUTRON_plugin_path}" = "openvswitch/ovs_neutron_plugin.ini" ] ; then
+ db_get neutron-plugin-openvswitch/tenant_network_type
+ pkgos_inifile set ${OVS_CONF} OVS tenant_network_type "${RET}"
+
+ db_get neutron-plugin-openvswitch/enable_tunneling
+ pkgos_inifile set ${OVS_CONF} OVS enable_tunneling "${RET}"
+
+ db_get neutron-plugin-openvswitch/tunnel_id_ranges
+ pkgos_inifile set ${OVS_CONF} OVS tunnel_id_ranges "${RET}"
+
+ db_get neutron-plugin-openvswitch/local_ip
+ pkgos_inifile set ${OVS_CONF} OVS local_ip "${RET}"
+ fi
db_stop
chown -R neutron:adm /var/log/neutron/
set -e
if [ "${1}" = "purge" ] ; then
+ if [ -f /usr/share/debconf/confmodule ] ; then
+ . /usr/share/debconf/confmodule
+ db_get neutron/configure_db
+ if [ "$RET" = "true" ] ; then
+ if [ -f /usr/share/dbconfig-common/dpkg/postrm ] ; then
+ . /usr/share/dbconfig-common/dpkg/postrm
+ dbc_go neutron-plugin-openvswitch $@
+ else
+ rm -f /etc/dbconfig-common/neutron-common.conf
+ if which ucf >/dev/null 2>&1; then
+ ucf --purge /etc/dbconfig-common/neutron-common.conf
+ ucfr --purge neutron-common /etc/dbconfig-common/neutron-common.conf
+ fi
+ fi
+ fi
+ fi
+
rm -rf /etc/default/neutron
rm -rf /etc/neutron/api-paste.ini /etc/neutron/neutron.conf
[ -d /etc/neutron ] && rmdir --ignore-fail-on-non-empty /etc/neutron
. /usr/share/debconf/confmodule
-db_get neutron-plugin-openvswitch/configure_db
+db_get neutron/configure_db
if [ "$RET" = "true" ]; then
. /usr/share/dbconfig-common/dpkg/prerm
- dbc_go neutron-plugin-openvswitch $@
+ dbc_go neutron-common $@
fi
#DEBHELPER#
Neutron server daemon, the configuration file corresponding to the plugin you
wish to use needs to be loaded. Please select which plugin configuration file
should be given as parameter when starting the Neutron server daemon.
+
+Template: neutron/configure_db
+Type: boolean
+Default: true
+_Description: Set up a database for neutron-plugin-openvswitch?
+ No database has been set up for neutron-plugin-openvswitch to use. Before
+ continuing, you should make sure you have the following information:
+ .
+ * the type of database that you want to use;
+ * the database server hostname (that server must allow TCP connections from this
+ machine);
+ * a username and password to access the database.
+ .
+ If some of these requirements are missing, do not choose this option and run with
+ regular SQLite support.
+ .
+ You can change this setting later on by running "dpkg-reconfigure -plow
+ neutron-plugin-openvswitch".
+
+Template: neutron-plugin-openvswitch/tenant_network_type
+Type: select
+__Choices: local, gre, vlan, none
+Choices-C: local, gre, vlan, none
+Default: gre
+# Translators: a "tenant" in OpenStack world is
+# an entity that contains one or more username/password couples.
+# It's typically the tenant that will be used for billing. Having more than one
+# username/password is very helpful in larger organization.
+# You're advised to either keep "tenant" without translating it
+# or keep it parenthezised. Example for French:
+# locataire ("tenant")
+_Description: Type of network to allocate for tenant networks:
+ The value "local" is useful only for single-box testing. In order for
+ tenant networks to provide connectivity between hosts, it is necessary
+ to either choose "vlan" and then configure "network_vlan_ranges" or to
+ choose "gre" and then configure "tunnel_id_ranges". Choose "none" to
+ disable creation of tenant networks.
+
+Template: neutron-plugin-openvswitch/enable_tunneling
+Type: boolean
+Default: true
+_Description: Enable tunneling?
+ Please choose whether support should be activated for GRE networks on the
+ server and agents. This requires kernel support for OVS patch ports and
+ GRE tunneling.
+
+Template: neutron-plugin-openvswitch/tunnel_id_ranges
+Type: string
+Default: 1:1000
+_Description: Tunnel id ranges:
+ Please enter a comma-separated list of <tun_min>:<tun_max> tuples enumerating
+ ranges of GRE tunnel IDs that are available for tenant network allocation
+ if tenant_network_type is "gre".
+
+Template: neutron-plugin-openvswitch/local_ip
+Type: string
+_Description: Local IP address of this hypervisor:
+ Please enter the local IP address for this hypervisor.
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-. /usr/share/debconf/confmodule
-
-OVS_CONF=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
-
-#PKGOS-INCLUDE#
-
-# Various network config...
-pkgos_read_config ${OVS_CONF} OVS tenant_network_type neutron-plugin-openvswitch/tenant_network_type
-pkgos_read_config ${OVS_CONF} OVS enable_tunneling neutron-plugin-openvswitch/enable_tunneling
-pkgos_read_config ${OVS_CONF} OVS tunnel_id_ranges neutron-plugin-openvswitch/tunnel_id_ranges
-
-# Guess values to put in the local_ip directive
-IF=`LC_ALL=C route | grep default |awk -- '{ print $8 }'`
-guessed_ip_addr=`LC_ALL=C ifconfig ${IF} | grep 'inet addr' | sed 's/.\+inet addr:\([0-9.]\+\).\+/\1/'`
-if [ -z "${guessed_ip_addr}" ] ; then
- guessed_ip_addr=`LC_ALL=C ifconfig ${IF} | grep 'inet adr' | sed 's/.\+inet adr:\([0-9.]\+\).\+/\1/'`
-fi
-db_set neutron-plugin-openvswitch/local_ip ${guessed_ip_addr}
-pkgos_read_config ${OVS_CONF} OVS local_ip neutron-plugin-openvswitch/local_ip
-
-# Configure the SQL connection
-pkgos_dbc_read_conf -pkg neutron-plugin-openvswitch ${OVS_CONF} DATABASE sql_connection neutron-plugin-openvswitch $@
-
-exit 0
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-OVS_CONF=/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
-
-#PKGOS-INCLUDE#
-
-if [ "$1" = "configure" ] ; then
- . /usr/share/debconf/confmodule
- . /usr/share/dbconfig-common/dpkg/postinst
-
- pkgos_var_user_group neutron
- chmod 755 /var/lib/neutron
-
- if [ ! -e ${OVS_CONF} ] ; then
- install -D -m 0640 -o neutron -g neutron /usr/share/neutron-plugin-openvswitch/ovs_neutron_plugin.ini ${OVS_CONF}
- fi
- pkgos_dbc_postinst --suite neutron ${OVS_CONF} DATABASE sql_connection neutron-plugin-openvswitch $@
-
- db_get neutron-plugin-openvswitch/tenant_network_type
- pkgos_inifile set ${OVS_CONF} OVS tenant_network_type "${RET}"
- db_get neutron-plugin-openvswitch/enable_tunneling
- pkgos_inifile set ${OVS_CONF} OVS enable_tunneling "${RET}"
- db_get neutron-plugin-openvswitch/tunnel_id_ranges
- pkgos_inifile set ${OVS_CONF} OVS tunnel_id_ranges "${RET}"
- db_get neutron-plugin-openvswitch/local_ip
- pkgos_inifile set ${OVS_CONF} OVS local_ip "${RET}"
-
- db_stop
-fi
-
-#DEBHELPER#
-
-exit 0
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-if [ "${1}" = "purge" ] ; then
- if [ -f /usr/share/debconf/confmodule ]; then
- . /usr/share/debconf/confmodule
- db_get neutron-plugin-openvswitch/configure_db
- if [ "$RET" = "true" ]; then
- if [ -f /usr/share/dbconfig-common/dpkg/postrm ] ; then
- . /usr/share/dbconfig-common/dpkg/postrm
- dbc_go neutron-plugin-openvswitch $@
- else
- rm -f /etc/dbconfig-common/neutron-plugin-openvswitch.conf
- if which ucf >/dev/null 2>&1; then
- ucf --purge /etc/dbconfig-common/neutron-plugin-openvswitch.conf
- ucfr --purge neutron-plugin-openvswitch /etc/dbconfig-common/neutron-plugin-openvswitch.conf
- fi
- fi
- fi
- fi
- [ -w /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini ] && rm -f /etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
- [ -d /etc/neutron/plugins/openvswitch ] && rmdir --ignore-fail-on-non-empty /etc/neutron/plugins/openvswitch
- [ -d /etc/neutron/plugins ] && rmdir --ignore-fail-on-non-empty /etc/neutron/plugins
- [ -d /etc/neutron ] && rmdir --ignore-fail-on-non-empty /etc/neutron
- rm -rf /var/lib/neutron-plugin-openvswitch
-fi
-
-#DEBHELPER#
-
-exit 0
+++ /dev/null
-# These templates have been reviewed by the debian-l10n-english
-# team
-#
-# If modifications/additions/rewording are needed, please ask
-# debian-l10n-english@lists.debian.org for advice.
-#
-# Even minor modifications require translation updates and such
-# changes should be coordinated with translators and reviewers.
-
-Template: neutron-plugin-openvswitch/configure_db
-Type: boolean
-Default: true
-_Description: Set up a database for neutron-plugin-openvswitch?
- No database has been set up for neutron-plugin-openvswitch to use. Before
- continuing, you should make sure you have the following information:
- .
- * the type of database that you want to use;
- * the database server hostname (that server must allow TCP connections from this
- machine);
- * a username and password to access the database.
- .
- If some of these requirements are missing, do not choose this option and run with
- regular SQLite support.
- .
- You can change this setting later on by running "dpkg-reconfigure -plow
- neutron-plugin-openvswitch".
-
-Template: neutron-plugin-openvswitch/tenant_network_type
-Type: select
-__Choices: local, gre, vlan, none
-Choices-C: local, gre, vlan, none
-Default: gre
-# Translators: a "tenant" in OpenStack world is
-# an entity that contains one or more username/password couples.
-# It's typically the tenant that will be used for billing. Having more than one
-# username/password is very helpful in larger organization.
-# You're advised to either keep "tenant" without translating it
-# or keep it parenthezised. Example for French:
-# locataire ("tenant")
-_Description: Type of network to allocate for tenant networks:
- The value "local" is useful only for single-box testing. In order for
- tenant networks to provide connectivity between hosts, it is necessary
- to either choose "vlan" and then configure "network_vlan_ranges" or to
- choose "gre" and then configure "tunnel_id_ranges". Choose "none" to
- disable creation of tenant networks.
-
-Template: neutron-plugin-openvswitch/enable_tunneling
-Type: boolean
-Default: true
-_Description: Enable tunneling?
- Please choose whether support should be activated for GRE networks on the
- server and agents. This requires kernel support for OVS patch ports and
- GRE tunneling.
-
-Template: neutron-plugin-openvswitch/tunnel_id_ranges
-Type: string
-Default: 1:1000
-_Description: Tunnel id ranges:
- Please enter a comma-separated list of <tun_min>:<tun_max> tuples enumerating
- ranges of GRE tunnel IDs that are available for tenant network allocation
- if tenant_network_type is "gre".
-
-Template: neutron-plugin-openvswitch/local_ip
-Type: string
-_Description: Local IP address of this hypervisor:
- Please enter the local IP address for this hypervisor.
-
# Install the default file
install -D -m 0640 debian/neutron.mydefault $(CURDIR)/debian/neutron-common/usr/share/neutron-common/neutron-default
+ # Move the OVS config file, since we use debconf for it
+ rm $(CURDIR)/debian/neutron-common/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini
+ install -D -m 0640 etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini $(CURDIR)/debian/neutron-common/usr/share/neutron-common/ovs_neutron_plugin.ini
+
override_dh_auto_clean:
dh_auto_clean
rm -f neutron/vcsversion.py