Skip to content

Instantly share code, notes, and snippets.

@the2hill
Created January 28, 2016 20:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save the2hill/5207564f12a0d54b3733 to your computer and use it in GitHub Desktop.
Save the2hill/5207564f12a0d54b3733 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This is meant to be executed from packer
if [ -z "$PACKER_BUILD_NAME" ] && [ -z "$PACKER_BUILDER_TYPE" ]; then
echo "Do not run by hand, this is run by packer"
exit 1
fi
export DEBIAN_FRONTEND=noninteractive
# Install required packages
apt-get install -q -y haproxy \
snmpd \
openssh-sftp-server \
python-pip \
python-dev \
libffi-dev \
libssl-dev \
git
pip install -U 'pyroute2>=0.3.10'
pip install --upgrade Werkzeug
# Setup Octavia, build from source for now
rm -rf /opt/octavia
git clone https://github.com/openstack/octavia.git /opt/octavia
cd /opt/octavia
git fetch https://ptoohill1@review.openstack.org/openstack/octavia refs/changes/21/237421/7 && git cherry-pick FETCH_HEAD
git fetch https://ptoohill1@review.openstack.org/openstack/octavia refs/changes/94/232294/27 && git cherry-pick FETCH_HEAD
cp etc/initd/amphora-agent /etc/init.d/
chmod +x /etc/init.d/amphora-agent
insserv amphora-agent
pip install -r requirements.txt
python setup.py install
# Remove base haproxy init.d script
rm /etc/init.d/haproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment