<%- | String $image_name = '', String $bind_socket = '' | -%> #!/bin/bash export DOCKER_HOST="<%=$bind_socket%>" ARGS="$@" # Extract the network namespace UUID from the command line args provided by # neutron. Typically of the form (with dnsmasq as an example): # # dnsmasq --no-hosts --no-resolv --except-interface=lo \ # --pid-file=/var/lib/neutron/dhcp/317716b8-919a-4a6f-8db1-78128ec3b100/pid \ # --dhcp-hostsfile=/var/lib/neutron/dhcp/317716b8-919a-4a6f-8db1-78128ec3b100/host ... NETNS=$(ip netns identify) NAME=neutron-haproxy-${NETNS} docker stop $NAME || true docker rm -f $NAME || true docker run --detach \ -v /var/lib/config-data/puppet-generated/neutron/etc/neutron:/etc/neutron:ro \ -v /run/netns:/run/netns:shared \ -v /var/lib/neutron:/var/lib/neutron \ --net host \ --pid host \ --privileged \ --rm=true \ -u root \ --name $NAME \ <%=$image_name%> \ ip netns exec ${NETNS} /usr/sbin/haproxy -Ds $ARGS