octavia/elements/rebind-sshd/finalise.d/98-rebind-sshd-after-dhcp
Michael Johnson f935a51fe4 Switch to ubuntu-minimal for default amphora image
Previously we were using the "ubuntu" diskimage-builder base element as the
default base OS to build the amphora image.
The "ubuntu" element is based on the ubuntu cloud image. This image includes
packages we do not need for the amphora image. At this point it's not clear
that Ubuntu will ship an 18.04 LTS cloud image in the format the "ubuntu"
element requires.
This patch switches the default Ubuntu amphora image to build with the
"ubuntu-minimal" diskimage-builder element.

This patch also moves the amphora agent into a virtual environment inside
the amphora.

It also sets up support for Ubuntu 18.04 (bionic beaver) and HAProxy 1.8.

Change-Id: I84a85ca1363bce2e0f13da64540ec7ba3575e818
2018-04-16 18:07:31 -07:00

18 lines
614 B
Bash
Executable File

#!/bin/bash
# isc dhcpd specific section
if [[ $DISTRO_NAME = "ubuntu" || $DISTRO_NAME = "debian" ]]; then
mkdir -p /etc/dhcp/dhclient-enter-hooks.d
echo '#!/bin/sh
if [ "$reason" = "BOUND" ]; then
if `grep -q "#ListenAddress 0.0.0.0" /etc/ssh/sshd_config`; then
/bin/sed -i "s/^#ListenAddress 0.0.0.0.*$/ListenAddress $new_ip_address/g" /etc/ssh/sshd_config
if `/bin/ps -ef|/bin/grep -v grep|/bin/grep -q sshd`; then
/usr/sbin/service ssh restart
fi
fi
fi' > /etc/dhcp/dhclient-enter-hooks.d/rebind-sshd
chmod +x /etc/dhcp/dhclient-enter-hooks.d/rebind-sshd
fi