5 . /usr/share/debconf/confmodule
7 N_CONF=/etc/neutron/neutron.conf
8 OVS_CONF=/etc/neutron/plugins/ml2/openvswitch_agent.ini
10 # Please remember this function is also in debian/plugin_guess_func
11 neutron_core_plugin_to_plugin_name () {
13 "neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2")
14 NEUTRON_PLUGIN_NAME=OpenVSwitch
16 "neutron.plugins.linuxbridge.lb_neutron_plugin.LinuxBridgePluginV2")
17 NEUTRON_PLUGIN_NAME=LinuxBridge
19 "neutron.plugins.ml2.plugin.Ml2Plugin")
20 NEUTRON_PLUGIN_NAME=ml2
22 "neutron.plugins.ryu.ryu_neutron_plugin.RyuNeutronPluginV2")
23 NEUTRON_PLUGIN_NAME=RYU
25 "neutron.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin.NeutronPluginPLUMgridV2")
26 NEUTRON_PLUGIN_NAME=PLUMgrid
28 "neutron.plugins.brocade.NeutronPlugin.BrocadePluginV2")
29 NEUTRON_PLUGIN_NAME=Brocade
31 "neutron.plugins.hyperv.hyperv_neutron_plugin.HyperVNeutronPlugin")
32 NEUTRON_PLUGIN_NAME=Hyper-V
34 "neutron.plugins.bigswitch.plugin.NeutronRestProxyV2")
35 NEUTRON_PLUGIN_NAME=BigSwitch
37 "neutron.plugins.cisco.network_plugin.PluginV2")
38 NEUTRON_PLUGIN_NAME=Cisco
40 "neutron.plugins.nicira.NeutronPlugin.NvpPluginV2")
41 NEUTRON_PLUGIN_NAME=neutron.plugins.nicira.NeutronPlugin.NvpPluginV2
43 "neutron.plugins.midonet.plugin.MidonetPluginV2")
44 NEUTRON_PLUGIN_NAME=Midonet
46 "neutron.plugins.nec.nec_plugin.NECPluginV2")
47 NEUTRON_PLUGIN_NAME=Nec
49 "neutron.plugins.metaplugin.meta_neutron_plugin.MetaPluginV2")
50 NEUTRON_PLUGIN_NAME=MetaPlugin
52 "neutron.plugins.mlnx.mlnx_plugin.MellanoxEswitchPlugin")
53 NEUTRON_PLUGIN_NAME=Mellanox
56 NEUTRON_PLUGIN_NAME="other"
63 pkgos_var_user_group neutron
64 chmod 755 /var/lib/neutron
66 # Configure the SQL connection
67 pkgos_dbc_read_conf -pkg neutron-common ${N_CONF} database connection neutron $@
68 pkgos_rabbit_read_conf ${N_CONF} oslo_messaging_rabbit neutron
70 # Configure the keystone_authtoken
71 pkgos_read_admin_creds ${N_CONF} keystone_authtoken neutron
73 # Select which plugin to use
74 if [ -r "${N_CONF}" ] ; then
75 pkgos_inifile get ${N_CONF} DEFAULT core_plugin
76 if [ -n "${RET}" ] ; then
77 NEUTRON_CORE_PLUGIN_CLASS=${RET}
78 neutron_core_plugin_to_plugin_name ${NEUTRON_CORE_PLUGIN_CLASS}
79 db_set neutron/plugin-select ${NEUTRON_PLUGIN_NAME}
82 db_input high neutron/plugin-select || true
84 db_get neutron/plugin-select
85 NEUTRON_PLUGIN_NAME=${RET}
87 # OVS specific configurations (if that's the one selected)
88 if [ "${NEUTRON_PLUGIN_NAME}" = "OpenVSwitch" ] ; then
89 # Various network config...
90 pkgos_read_config ${OVS_CONF} OVS tenant_network_type neutron/tenant_network_type
91 pkgos_read_config ${OVS_CONF} OVS enable_tunneling neutron/enable_tunneling
92 pkgos_read_config ${OVS_CONF} OVS tunnel_id_ranges neutron/tunnel_id_ranges
94 # Guess values to put in the local_ip directive
95 IF=`LC_ALL=C route | grep default |awk -- '{ print $8 }'`
96 guessed_ip_addr=`LC_ALL=C ifconfig ${IF} | grep 'inet addr' | sed 's/.\+inet addr:\([0-9.]\+\).\+/\1/'`
97 if [ -z "${guessed_ip_addr}" ] ; then
98 guessed_ip_addr=`LC_ALL=C ifconfig ${IF} | grep 'inet adr' | sed 's/.\+inet adr:\([0-9.]\+\).\+/\1/'`
100 db_set neutron/local_ip ${guessed_ip_addr}
101 pkgos_read_config ${OVS_CONF} OVS local_ip neutron/local_ip