diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-10-27 09:10:48 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-10-27 09:10:48 +0000 |
commit | 19d3ce76b9f785ee34457482415dee9bc4aaf9d2 (patch) | |
tree | e2525d92184b752d7bdd9e87a862b11a848b850f /mason | |
parent | 6b9c0c1ba8b23741349c535adf426a9e8a41d3c1 (diff) | |
parent | b3a7c84e3dfb3385b7c5f5cc104ab2f6be278b91 (diff) | |
download | definitions-19d3ce76b9f785ee34457482415dee9bc4aaf9d2.tar.gz |
Merge branch 'baserock/adamcoldrick/mason-openstack-rebased'
Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
Reviewed-By: Sam Thursfield <sam.thursfield@codethink.co.uk>
Diffstat (limited to 'mason')
-rw-r--r-- | mason/ansible/mason-setup.yml | 28 | ||||
-rw-r--r-- | mason/mason.service | 1 | ||||
-rwxr-xr-x | mason/mason.sh | 22 | ||||
-rw-r--r-- | mason/os-init-script | 6 | ||||
-rw-r--r-- | mason/share/mason.conf | 4 | ||||
-rw-r--r-- | mason/share/os.conf | 30 |
6 files changed, 85 insertions, 6 deletions
diff --git a/mason/ansible/mason-setup.yml b/mason/ansible/mason-setup.yml index 70c77871..08490e78 100644 --- a/mason/ansible/mason-setup.yml +++ b/mason/ansible/mason-setup.yml @@ -2,6 +2,7 @@ - hosts: localhost vars_files: - "/etc/mason/mason.conf" + - "/etc/mason/os.conf" tasks: @@ -29,11 +30,38 @@ - fail: msg='CONTROLLERHOST is mandatory' when: CONTROLLERHOST is not defined + - fail: msg='TEST_INFRASTRUCTURE_TYPE is mandatory' + when: TEST_INFRASTRUCTURE_TYPE is not defined + + - fail: msg='OPENSTACK_NETWORK_ID is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OPENSTACK_NETWORK_ID is not defined + + - fail: msg='OS_USERNAME is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_USERNAME is not defined + + - fail: msg='OS_PASSWORD is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_PASSWORD is not defined + + - fail: msg='OS_TENANT_ID is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_TENANT_ID is not defined + + - fail: msg='OS_TENANT_NAME is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_TENANT_NAME is not defined + + - fail: msg='OS_AUTH_URL is mandatory when TEST_INFRASTRUCTURE_TYPE=openstack' + when: TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_AUTH_URL is not defined + - name: Create the Mason configuration file template: src=/usr/share/mason-setup/{{ item }} dest=/etc/{{ item }} with_items: - mason.conf + - name: Create the OpenStack credentials file + template: src=/usr/share/mason-setup/{{ item }} dest=/etc/{{ item }} + with_items: + - os.conf + when: TEST_INFRASTRUCTURE_TYPE == "openstack" + - name: Enable the mason service service: name=mason.service enabled=yes register: mason_service diff --git a/mason/mason.service b/mason/mason.service index ab2338c5..a864d610 100644 --- a/mason/mason.service +++ b/mason/mason.service @@ -1,5 +1,6 @@ [Unit] Description=Mason: Continuous Delivery Service +After=mason-setup.service [Service] User=root diff --git a/mason/mason.sh b/mason/mason.sh index 32aab032..5d27b7cf 100755 --- a/mason/mason.sh +++ b/mason/mason.sh @@ -1,5 +1,8 @@ #!/bin/sh +# Load OpenStack credentials +. /etc/os.conf + set -e set -x @@ -59,11 +62,20 @@ else echo INFO: Created "$releases_made" release images fi -"scripts/release-test" \ - --deployment-host "$DISTBUILD_ARCH":"$TEST_VM_HOST_SSH_URL" \ - --trove-host "$UPSTREAM_TROVE_ADDRESS" \ - --trove-id "$TROVE_ID" \ - "$BUILD_CLUSTER_MORPHOLOGY" +if [ "$TEST_INFRASTRUCTURE_TYPE" = "openstack" ]; then + "scripts/release-test-os" \ + --deployment-host "$DISTBUILD_ARCH":"$MASON_TEST_HOST" \ + --trove-host "$UPSTREAM_TROVE_ADDRESS" \ + --trove-id "$TROVE_ID" \ + --net-id "$OPENSTACK_NETWORK_ID" \ + "$BUILD_CLUSTER_MORPHOLOGY" +elif [ "$TEST_INFRASTRUCTURE_TYPE" = "kvmhost" ]; then + "scripts/release-test" \ + --deployment-host "$DISTBUILD_ARCH":"$MASON_TEST_HOST" \ + --trove-host "$UPSTREAM_TROVE_ADDRESS" \ + --trove-id "$TROVE_ID" \ + "$BUILD_CLUSTER_MORPHOLOGY" +fi "scripts/release-upload" --build-trove-host "$ARTIFACT_CACHE_SERVER" \ --arch "$DISTBUILD_ARCH" \ diff --git a/mason/os-init-script b/mason/os-init-script new file mode 100644 index 00000000..77afb926 --- /dev/null +++ b/mason/os-init-script @@ -0,0 +1,6 @@ +#!/bin/bash + +# This allows the test runner to know that cloud-init has completed the +# disc resizing, and there is enough free space to continue. +touch /root/cloud-init-finished + diff --git a/mason/share/mason.conf b/mason/share/mason.conf index b323896d..abbf357a 100644 --- a/mason/share/mason.conf +++ b/mason/share/mason.conf @@ -9,4 +9,6 @@ DISTBUILD_ARCH={{ MASON_DISTBUILD_ARCH|quote }} DISTBUILD_CONTROLLER_ADDRESS={{ CONTROLLERHOST|quote }} TROVE_ID={{ TROVE_ID|quote }} BUILD_CLUSTER_MORPHOLOGY={{ MASON_CLUSTER_MORPHOLOGY|quote }} -TEST_VM_HOST_SSH_URL={{ MASON_TEST_HOST|quote }} +MASON_TEST_HOST={{ MASON_TEST_HOST|quote }} +TEST_INFRASTRUCTURE_TYPE={{ TEST_INFRASTRUCTURE_TYPE|quote }} +OPENSTACK_NETWORK_ID={{ OPENSTACK_NETWORK_ID|quote }} diff --git a/mason/share/os.conf b/mason/share/os.conf new file mode 100644 index 00000000..21ef398c --- /dev/null +++ b/mason/share/os.conf @@ -0,0 +1,30 @@ +#!/bin/bash + +# A version of this file with the relevant information included can be +# obtained by navigating to 'Access & Security' -> 'API Access' -> +# 'Download OpenStack RC file' in The Horizon web interface of your +# OpenStack. However, the file obtained from there sets OS_PASSWORD +# such that it will ask the user for a password, so you will need to +# change that for Mason to work automatically. +# +# With the addition of Keystone, to use an openstack cloud you should +# authenticate against keystone, which returns a **Token** and **Service +# Catalog**. The catalog contains the endpoint for all services the +# user/tenant has access to - including nova, glance, keystone, swift. +# +# *NOTE*: Using the 2.0 *auth api* does not mean that compute api is 2.0. We +# will use the 1.1 *compute api* +export OS_AUTH_URL={{ OS_AUTH_URL|quote }} + +# With the addition of Keystone we have standardized on the term **tenant** +# as the entity that owns the resources. +export OS_TENANT_ID={{ OS_TENANT_ID|quote }} +export OS_TENANT_NAME={{ OS_TENANT_NAME|quote }} + +# In addition to the owning entity (tenant), openstack stores the entity +# performing the action as the **user**. +export OS_USERNAME={{ OS_USERNAME|quote }} + +# With Keystone you pass the keystone password. +export OS_PASSWORD={{ OS_PASSWORD|quote }} + |