Skip to content

Instantly share code, notes, and snippets.

@brandonlogan
Created June 25, 2014 02:22
Show Gist options
  • Save brandonlogan/9f9575d57c1d789a8da7 to your computer and use it in GitHub Desktop.
Save brandonlogan/9f9575d57c1d789a8da7 to your computer and use it in GitHub Desktop.
match1='service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default'
insert1='service_provider=LOADBALANCERv2:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriverv2:default'
match2='service_plugins = neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.loadbalancer.plugin.LoadBalancerPlugin'
insert2='service_plugins = neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.loadbalancer.plugin.LoadBalancerPlugin,neutron.services.loadbalancer.plugin.LoadBalancerPluginv2'
file='/etc/neutron/neutron.conf'
if [ ! "$(grep $insert1 $file)" ]; then
sed -i "s/$match1/$match1\n$insert1/" $file
fi
if [ ! "$(grep $insert2 $file)" ]; then
sed -i "s/$match2/$insert2/" $file
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment