summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-11-19 17:24:56 (GMT)
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2014-11-19 17:24:56 (GMT)
commit87df3c1fca6771141fd045785e8118289e6503d6 (patch)
tree8e67f899e80b0874740c96e00756d376726c5abe
parent0f90d4a8219199f6941da600f173f96b06bc5a52 (diff)
parentf85eaa58f6e68dd1641246e68b8ab9e87a5b7633 (diff)
downloaddefinitions-87df3c1fca6771141fd045785e8118289e6503d6.tar.gz
Merge branch 'baserock/pedroalvarez/fix-generic-mason'
Reviewed-by: - Richard Maw - Francisco Redondo Marchena
-rw-r--r--mason.configure60
-rw-r--r--mason/ansible/mason-setup.yml1
-rwxr-xr-xmason/mason.sh4
-rw-r--r--mason/share/mason.conf2
4 files changed, 33 insertions, 34 deletions
diff --git a/mason.configure b/mason.configure
index 621d6a3..1198ebd 100644
--- a/mason.configure
+++ b/mason.configure
@@ -32,36 +32,6 @@
set -e
-
-##########################################################################
-# Check variables
-##########################################################################
-
-if [ -n "$MASON_GENERIC" ]; then
- echo Not configuring Mason, it will be generic
- exit 0
-fi
-
-if [ -z "$MASON_CLUSTER_MORPHOLOGY" -a \
- -z "$MASON_DEFINITIONS_REF" -a \
- -z "$MASON_DISTBUILD_ARCH" -a \
- -z "$MASON_TEST_HOST" ]; then
- # No Mason options defined, do nothing.
- exit 0
-fi
-
-if [ -z "$ARTIFACT_CACHE_SERVER" -o \
- -z "$CONTROLLERHOST" -o \
- -z "$MASON_CLUSTER_MORPHOLOGY" -o \
- -z "$MASON_DEFINITIONS_REF" -o \
- -z "$MASON_DISTBUILD_ARCH" -o \
- -z "$MASON_TEST_HOST" -o \
- -z "$TROVE_HOST" -o \
- -z "$TROVE_ID" ]; then
- echo Some options required for Mason were defined, but not all.
- exit 1
-fi
-
##########################################################################
# Copy Mason files into root filesystem
##########################################################################
@@ -104,6 +74,34 @@ cp mason/mason-setup.service "$ROOT"/etc/systemd/system/mason-setup.service
ln -s ../mason-setup.service "$ROOT"/etc/systemd/system/multi-user.target.wants/mason-setup.service
+##########################################################################
+# Check variables
+##########################################################################
+
+if [ -n "$MASON_GENERIC" ]; then
+ echo Not configuring Mason, it will be generic
+ exit 0
+fi
+
+if [ -z "$MASON_CLUSTER_MORPHOLOGY" -a \
+ -z "$MASON_DEFINITIONS_REF" -a \
+ -z "$MASON_DISTBUILD_ARCH" -a \
+ -z "$MASON_TEST_HOST" ]; then
+ # No Mason options defined, do nothing.
+ exit 0
+fi
+
+if [ -z "$ARTIFACT_CACHE_SERVER" -o \
+ -z "$CONTROLLERHOST" -o \
+ -z "$MASON_CLUSTER_MORPHOLOGY" -o \
+ -z "$MASON_DEFINITIONS_REF" -o \
+ -z "$MASON_DISTBUILD_ARCH" -o \
+ -z "$MASON_TEST_HOST" -o \
+ -z "$TROVE_HOST" -o \
+ -z "$TROVE_ID" ]; then
+ echo Some options required for Mason were defined, but not all.
+ exit 1
+fi
##########################################################################
# Generate config variable shell snippet
@@ -132,7 +130,7 @@ yaml.dump(mason_configuration, sys.stdout, default_flow_style=False)
EOF
if [ "$TEST_INFRASTRUCTURE_TYPE" = "openstack" ]; then
- python <<'EOF' >"$MASON_DATA/os.conf"
+ python <<'EOF' >>"$MASON_DATA/mason.conf"
import os, sys, yaml
openstack_credentials={
diff --git a/mason/ansible/mason-setup.yml b/mason/ansible/mason-setup.yml
index 08490e7..d1528db 100644
--- a/mason/ansible/mason-setup.yml
+++ b/mason/ansible/mason-setup.yml
@@ -2,7 +2,6 @@
- hosts: localhost
vars_files:
- "/etc/mason/mason.conf"
- - "/etc/mason/os.conf"
tasks:
diff --git a/mason/mason.sh b/mason/mason.sh
index 5d27b7c..dba99df 100755
--- a/mason/mason.sh
+++ b/mason/mason.sh
@@ -1,7 +1,9 @@
#!/bin/sh
# Load OpenStack credentials
-. /etc/os.conf
+if [ -f "/etc/os.conf" ]; then
+ . /etc/os.conf
+fi
set -e
set -x
diff --git a/mason/share/mason.conf b/mason/share/mason.conf
index abbf357..1295ce8 100644
--- a/mason/share/mason.conf
+++ b/mason/share/mason.conf
@@ -11,4 +11,4 @@ TROVE_ID={{ TROVE_ID|quote }}
BUILD_CLUSTER_MORPHOLOGY={{ MASON_CLUSTER_MORPHOLOGY|quote }}
MASON_TEST_HOST={{ MASON_TEST_HOST|quote }}
TEST_INFRASTRUCTURE_TYPE={{ TEST_INFRASTRUCTURE_TYPE|quote }}
-OPENSTACK_NETWORK_ID={{ OPENSTACK_NETWORK_ID|quote }}
+{% if OPENSTACK_NETWORK_ID is defined %}OPENSTACK_NETWORK_ID={{ OPENSTACK_NETWORK_ID|quote }}{% endif %}