blob: f95fcb75b9bc17de044d9633155f53ba319f2d98 [file] [log] [blame]
av-mido2c3428b2013-07-11 14:59:00 +09001# Neutron MidoNet plugin
2# ----------------------
3
4# Save trace setting
5MY_XTRACE=$(set +o | grep xtrace)
6set +o xtrace
7
8function is_neutron_ovs_base_plugin() {
9 # MidoNet does not use l3-agent
10 # 0 means True here
11 return 1
12}
13
14function neutron_plugin_create_nova_conf() {
Joe Millsa2fd2222013-10-04 11:46:10 +000015 NOVA_VIF_DRIVER=${NOVA_VIF_DRIVER:-"nova.virt.libvirt.vif.LibvirtGenericVIFDriver"}
av-mido2c3428b2013-07-11 14:59:00 +090016}
17
18function neutron_plugin_install_agent_packages() {
19 :
20}
21
22function neutron_plugin_configure_common() {
23 Q_PLUGIN_CONF_PATH=etc/neutron/plugins/midonet
24 Q_PLUGIN_CONF_FILENAME=midonet.ini
25 Q_DB_NAME="neutron_midonet"
26 Q_PLUGIN_CLASS="neutron.plugins.midonet.plugin.MidonetPluginV2"
27}
28
29function neutron_plugin_configure_debug_command() {
30 :
31}
32
33function neutron_plugin_configure_dhcp_agent() {
Ryu Ishimoto35f09662013-08-27 18:32:00 +090034 DHCP_DRIVER=${DHCP_DRIVER:-"neutron.plugins.midonet.agent.midonet_driver.DhcpNoOpDriver"}
Joe Millse4a523f2013-10-28 07:38:55 +000035 neutron_plugin_setup_interface_driver $Q_DHCP_CONF_FILE
Ryu Ishimoto35f09662013-08-27 18:32:00 +090036 iniset $Q_DHCP_CONF_FILE DEFAULT dhcp_driver $DHCP_DRIVER
Ryu Ishimoto35f09662013-08-27 18:32:00 +090037 iniset $Q_DHCP_CONF_FILE DEFAULT use_namespaces True
38 iniset $Q_DHCP_CONF_FILE DEFAULT enable_isolated_metadata True
av-mido2c3428b2013-07-11 14:59:00 +090039}
40
41function neutron_plugin_configure_l3_agent() {
Sean Dague3bdb9222013-10-22 08:36:16 -040042 die $LINENO "q-l3 must not be executed with MidoNet plugin!"
av-mido2c3428b2013-07-11 14:59:00 +090043}
44
45function neutron_plugin_configure_plugin_agent() {
Sean Dague3bdb9222013-10-22 08:36:16 -040046 die $LINENO "q-agt must not be executed with MidoNet plugin!"
av-mido2c3428b2013-07-11 14:59:00 +090047}
48
49function neutron_plugin_configure_service() {
50 if [[ "$MIDONET_API_URI" != "" ]]; then
51 iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URI
52 fi
53 if [[ "$MIDONET_USERNAME" != "" ]]; then
54 iniset /$Q_PLUGIN_CONF_FILE MIDONET username $MIDONET_USERNAME
55 fi
56 if [[ "$MIDONET_PASSWORD" != "" ]]; then
57 iniset /$Q_PLUGIN_CONF_FILE MIDONET password $MIDONET_PASSWORD
58 fi
59 if [[ "$MIDONET_PROJECT_ID" != "" ]]; then
60 iniset /$Q_PLUGIN_CONF_FILE MIDONET project_id $MIDONET_PROJECT_ID
61 fi
62 if [[ "$MIDONET_PROVIDER_ROUTER_ID" != "" ]]; then
63 iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $MIDONET_PROVIDER_ROUTER_ID
64 fi
Tomoe Sugihara81fe5f52013-11-14 20:04:44 +000065
66 Q_L3_ENABLED=True
67 Q_L3_ROUTER_PER_TENANT=True
av-mido2c3428b2013-07-11 14:59:00 +090068}
69
70function neutron_plugin_setup_interface_driver() {
Joe Millse4a523f2013-10-28 07:38:55 +000071 local conf_file=$1
72 iniset $conf_file DEFAULT interface_driver neutron.agent.linux.interface.MidonetInterfaceDriver
av-mido2c3428b2013-07-11 14:59:00 +090073}
74
75function has_neutron_plugin_security_group() {
76 # 0 means True here
77 return 0
78}
79
80function neutron_plugin_check_adv_test_requirements() {
81 # 0 means True here
82 return 1
83}
84
85# Restore xtrace
86$MY_XTRACE