diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index 2d48801118..a526973c6f 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -148,6 +148,8 @@ AMP_IMAGESIZE=${AMP_IMAGESIZE:-5} OCTAVIA_ELEMENTS_PATH=$OCTAVIA_REPO_PATH/elements + + if ! [ -d $OCTAVIA_ELEMENTS_PATH ]; then echo "ERROR: Octavia elements directory not found at: " $OCTAVIA_ELEMENTS_PATH " Exiting." exit 1 @@ -328,6 +330,9 @@ fi # Add the Octavia Amphora agent.py element AMP_element_sequence="$AMP_element_sequence amphora-agent" +# Add the vrrp Octacia element +AMP_element_sequence="$AMP_element_sequence vrrp-octavia" + # Allow full elements override if [ "$DIB_ELEMENTS" ]; then AMP_element_sequence="$DIB_ELEMENTS" diff --git a/diskimage-create/image-tests.sh b/diskimage-create/image-tests.sh index 1041f077b6..8b672c9551 100755 --- a/diskimage-create/image-tests.sh +++ b/diskimage-create/image-tests.sh @@ -86,5 +86,17 @@ else echo "HAProxy package found in the Amphora image" fi +# Check for KeepAlived +virt-inspector $AMP_IMAGE_LOCATION | \ + virt-inspector --xpath \ + '/operatingsystems/operatingsystem/applications/application/name[text()="keepalived"]' \ + | grep -q 'keepalived' +if [ $? != 0 ]; then + echo "ERROR: Amphora image is missing the keepalived package" + exit 1 +else + echo "keepalived package found in the Amphora image" +fi echo "Amphora image looks good." + exit 0 diff --git a/elements/vrrp-octavia/README.rst b/elements/vrrp-octavia/README.rst new file mode 100644 index 0000000000..3db03dc16b --- /dev/null +++ b/elements/vrrp-octavia/README.rst @@ -0,0 +1,3 @@ +Element to install keepalived. + + diff --git a/elements/vrrp-octavia/element-deps b/elements/vrrp-octavia/element-deps new file mode 100644 index 0000000000..715c11e2f5 --- /dev/null +++ b/elements/vrrp-octavia/element-deps @@ -0,0 +1 @@ +source-repositories diff --git a/elements/vrrp-octavia/install.d/77-vrrp b/elements/vrrp-octavia/install.d/77-vrrp new file mode 100755 index 0000000000..f6b2c474ea --- /dev/null +++ b/elements/vrrp-octavia/install.d/77-vrrp @@ -0,0 +1,9 @@ +#!/bin/bash +set -eux + +#Checks out keepalived version 1.2.13, compiles and installs binaries. +cd /opt/vrrp-octavia/ +git checkout v1.2.13 +./configure +make +make install diff --git a/elements/vrrp-octavia/source-repository-vrrp-octavia b/elements/vrrp-octavia/source-repository-vrrp-octavia new file mode 100644 index 0000000000..50bcd6e557 --- /dev/null +++ b/elements/vrrp-octavia/source-repository-vrrp-octavia @@ -0,0 +1,2 @@ +# Clone source for keepalived version 1.2.13. Correct version is in the installation script +vrrp-octavia git /opt/vrrp-octavia https://github.com/acassen/keepalived diff --git a/elements/vrrp-octavia/svc-map b/elements/vrrp-octavia/svc-map new file mode 100644 index 0000000000..614c8a4f20 --- /dev/null +++ b/elements/vrrp-octavia/svc-map @@ -0,0 +1,2 @@ +vrrp-octavia: + default: vrrp-octavia