summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-12-11 17:57:23 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2015-05-14 15:09:39 +0000
commit14758300d8ed79961fac9dd6b800111ea7184739 (patch)
treee9e7e17a1d1e0607aba87a431cf525e6f5d5a747
parentc53845a57b1c0c3df3e9dc9c6d6c33121d54e82e (diff)
downloadinfrastructure-14758300d8ed79961fac9dd6b800111ea7184739.tar.gz
Make mason.configure install the new Mason config
-rw-r--r--mason.configure140
-rw-r--r--mason.configure.help127
-rw-r--r--mason/ansible/mason-setup.yml129
-rw-r--r--mason/lighttpd.service (renamed from mason/httpd.service)2
-rwxr-xr-xmason/mason-generator.sh101
-rwxr-xr-xmason/mason-report.sh252
-rw-r--r--mason/mason.service10
-rwxr-xr-xmason/mason.sh93
-rw-r--r--mason/mason.timer10
-rw-r--r--mason/share/lighttpd.conf21
-rw-r--r--mason/share/mason.conf14
-rw-r--r--mason/share/os.conf1
-rw-r--r--mason/share/turbo-hipster-config.yaml47
-rw-r--r--mason/share/zuul-layout.yaml22
-rw-r--r--mason/share/zuul-logging.conf44
-rw-r--r--mason/share/zuul.conf26
-rw-r--r--mason/ssh-config2
-rw-r--r--mason/turbo-hipster.service10
-rw-r--r--mason/zuul-merger.service10
-rw-r--r--mason/zuul-server.service10
20 files changed, 479 insertions, 592 deletions
diff --git a/mason.configure b/mason.configure
index 1198ebd0..e0be6b2e 100644
--- a/mason.configure
+++ b/mason.configure
@@ -14,21 +14,6 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# This is a "morph deploy" configuration extension to fully configure
-# a Mason instance at deployment time. It uses the following variables
-# from the environment:
-#
-# * ARTIFACT_CACHE_SERVER
-# * MASON_CLUSTER_MORPHOLOGY
-# * MASON_DEFINITIONS_REF
-# * MASON_DISTBUILD_ARCH
-# * MASON_TEST_HOST
-# * OPENSTACK_NETWORK_ID
-# * TEST_INFRASTRUCTURE_TYPE
-# * TROVE_HOST
-# * TROVE_ID
-# * CONTROLLERHOST
set -e
@@ -39,27 +24,21 @@ set -e
ROOT="$1"
mkdir -p "$ROOT"/usr/lib/mason
-cp mason/mason.sh "$ROOT"/usr/lib/mason/mason.sh
-cp mason/mason-report.sh "$ROOT"/usr/lib/mason/mason-report.sh
cp mason/os-init-script "$ROOT"/usr/lib/mason/os-init-script
-cp mason/mason.timer "$ROOT"/etc/systemd/system/mason.timer
-
-cp mason/mason.service "$ROOT"/etc/systemd/system/mason.service
+cp mason/mason-setup.service "$ROOT"/usr/lib/systemd/system/mason-setup.service
+cp mason/zuul-server.service "$ROOT"/usr/lib/systemd/system/zuul-server.service
+cp mason/zuul-merger.service "$ROOT"/usr/lib/systemd/system/zuul-merger.service
+cp mason/turbo-hipster.service "$ROOT"/usr/lib/systemd/system/turbo-hipster.service
+cp mason/lighttpd.service "$ROOT"/usr/lib/systemd/system/lighttpd.service
##########################################################################
-# Set up httpd web server
+# Create required directories
##########################################################################
-cp mason/httpd.service "$ROOT"/etc/systemd/system/httpd.service
-
-mkdir -p "$ROOT"/srv/mason
-
-cat >>"$ROOT"/etc/httpd.conf <<EOF
-.log:text/plain
-EOF
-
-mkdir -p "$ROOT"/var/mason
+mkdir -p "$ROOT"/var/www/logs
+mkdir -p "$ROOT"/var/lib/zuul
+mkdir -p "$ROOT"/var/log/zuul
##########################################################################
# Copy files needed for Ansible configuration
@@ -70,7 +49,6 @@ mkdir -p "$ROOT/usr/lib/mason-setup"
cp mason/share/* "$ROOT/usr/share/mason-setup"
cp -r mason/ansible "$ROOT/usr/lib/mason-setup/"
-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
@@ -84,26 +62,64 @@ if [ -n "$MASON_GENERIC" ]; then
fi
if [ -z "$MASON_CLUSTER_MORPHOLOGY" -a \
- -z "$MASON_DEFINITIONS_REF" -a \
- -z "$MASON_DISTBUILD_ARCH" -a \
- -z "$MASON_TEST_HOST" ]; then
+ -z "$MASON_ARCHITECTURE" -a \
+ -z "$MASON_TEST_HOSTS" -a \
+ -z "$MASON_DISTBUILD_CONTROLLERS" -a \
+ -z "$MASON_TEST_INFRASTRUCTURE_TYPE" -a \
+ -z "$MASON_UPSTREAM_TROVE" ]; 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 \
+if [ -z "GERRIT_HTTP_PORT" ]; then
+ GERRIT_HTTP_PORT="8080"
+fi
+
+if [ -z "GERRIT_GIT_PORT" ]; then
+ GERRIT_GIT_PORT="29418"
+fi
+
+if [ -z "GEARMAN_PORT" ]; then
+ GEARMAN_PORT="4730"
+fi
+
+if [ -z "START_GEARMAN" ]; then
+ START_GEARMAN="yes"
+fi
+
+if [ -z "$TROVE_ID" -o \
-z "$TROVE_HOST" -o \
- -z "$TROVE_ID" ]; then
+ -z "$ARTIFACT_CACHE_SERVER" -o \
+ -z "$GERRIT_USER" -o \
+ -z "$GERRIT_HOSTNAME" -o \
+ -z "$GERRIT_HTTP_PORT" -o \
+ -z "$GERRIT_GIT_PORT" -o \
+ -z "$GERRIT_SSH_KEY" -o \
+ -z "$GERRIT_SSH_KEY_PATH" -o \
+ -z "$GEARMAN_HOST" -o \
+ -z "$GEARMAN_PORT" -o \
+ -z "$START_GEARMAN" -o \
+ -z "$MASON_CLUSTER_MORPHOLOGY" -o \
+ -z "$MASON_ARCHITECTURE" -o \
+ -z "$MASON_TEST_HOSTS" -o \
+ -z "$MASON_DISTBUILD_CONTROLLERS" -o \
+ -z "$MASON_TEST_INFRASTRUCTURE_TYPE" -o \
+ -z "$MASON_UPSTREAM_TROVE" ]; then
echo Some options required for Mason were defined, but not all.
exit 1
fi
##########################################################################
+# Copy SSH keys into the system
+##########################################################################
+
+ssh_dir=$(dirname "$ROOT$GERRIT_SSH_KEY_PATH")
+mkdir -p "$ssh_dir"
+cp -a "$GERRIT_SSH_KEY" "$ROOT$GERRIT_SSH_KEY_PATH"
+cp -a "$GERRIT_SSH_KEY".pub "$ROOT$GERRIT_SSH_KEY_PATH".pub
+cp -a mason/ssh-config "$ssh_dir"/config
+
+##########################################################################
# Generate config variable shell snippet
##########################################################################
@@ -114,40 +130,40 @@ python <<'EOF' >"$MASON_DATA/mason.conf"
import os, sys, yaml
mason_configuration={
- 'ARTIFACT_CACHE_SERVER': os.environ['ARTIFACT_CACHE_SERVER'],
- 'MASON_CLUSTER_MORPHOLOGY': os.environ['MASON_CLUSTER_MORPHOLOGY'],
- 'MASON_DEFINITIONS_REF': os.environ['MASON_DEFINITIONS_REF'],
- 'MASON_DISTBUILD_ARCH': os.environ['MASON_DISTBUILD_ARCH'],
- 'MASON_TEST_HOST': os.environ['MASON_TEST_HOST'],
- 'OPENSTACK_NETWORK_ID': os.environ['OPENSTACK_NETWORK_ID'],
- 'TEST_INFRASTRUCTURE_TYPE': os.environ['TEST_INFRASTRUCTURE_TYPE'],
'TROVE_ID': os.environ['TROVE_ID'],
'TROVE_HOST': os.environ['TROVE_HOST'],
- 'CONTROLLERHOST': os.environ['CONTROLLERHOST'],
+ 'ARTIFACT_CACHE_SERVER': os.environ['ARTIFACT_CACHE_SERVER'],
+ 'GERRIT_USER': os.environ['GERRIT_USER'],
+ 'GERRIT_HOSTNAME': os.environ['GERRIT_HOSTNAME'],
+ 'GERRIT_HTTP_PORT': os.environ['GERRIT_HTTP_PORT'],
+ 'GERRIT_GIT_PORT': os.environ['GERRIT_GIT_PORT'],
+ 'GERRIT_SSH_KEY_PATH': os.environ['GERRIT_SSH_KEY_PATH'],
+ 'GEARMAN_HOST': os.environ['GEARMAN_HOST'],
+ 'GEARMAN_PORT': os.environ['GEARMAN_PORT'],
+ 'START_GEARMAN': os.environ['START_GEARMAN'],
+ 'MASON_CLUSTER_MORPHOLOGY': os.environ['MASON_CLUSTER_MORPHOLOGY'],
+ 'MASON_ARCHITECTURE': os.environ['MASON_ARCHITECTURE'],
+ 'MASON_TEST_HOSTS': os.environ['MASON_TEST_HOSTS'],
+ 'MASON_DISTBUILD_CONTROLLERS': os.environ['MASON_DISTBUILD_CONTROLLERS'],
+ 'MASON_TEST_INFRASTRUCTURE_TYPE': os.environ['MASON_TEST_INFRASTRUCTURE_TYPE'],
+ 'MASON_UPSTREAM_TROVE': os.environ['MASON_UPSTREAM_TROVE'],
}
yaml.dump(mason_configuration, sys.stdout, default_flow_style=False)
EOF
-if [ "$TEST_INFRASTRUCTURE_TYPE" = "openstack" ]; then
+if [ "$MASON_TEST_INFRASTRUCTURE_TYPE" = "openstack" ]; then
python <<'EOF' >>"$MASON_DATA/mason.conf"
import os, sys, yaml
openstack_credentials={
- 'OS_USERNAME': os.environ['OPENSTACK_USER'],
- 'OS_TENANT_NAME': os.environ['OPENSTACK_TENANT'],
- 'OS_TENANT_ID': os.environ['OPENSTACK_TENANT_ID'],
- 'OS_AUTH_URL': os.environ['OPENSTACK_AUTH_URL'],
- 'OS_PASSWORD': os.environ['OPENSTACK_PASSWORD'],
+ 'OPENSTACK_NETWORK_ID': os.environ['MASON_OPENSTACK_NETWORK_ID'],
+ 'OS_USERNAME': os.environ['MASON_OPENSTACK_USER'],
+ 'OS_TENANT_NAME': os.environ['MASON_OPENSTACK_TENANT'],
+ 'OS_AUTH_URL': os.environ['MASON_OPENSTACK_AUTH_URL'],
+ 'OS_PASSWORD': os.environ['MASON_OPENSTACK_PASSWORD'],
}
yaml.dump(openstack_credentials, sys.stdout, default_flow_style=False)
EOF
fi
-
-##########################################################################
-# Enable services
-##########################################################################
-
-ln -s ../mason.timer "$ROOT"/etc/systemd/system/multi-user.target.wants/mason.timer
-ln -s ../httpd.service "$ROOT"/etc/systemd/system/multi-user.target.wants/httpd.service
diff --git a/mason.configure.help b/mason.configure.help
new file mode 100644
index 00000000..d7b9926d
--- /dev/null
+++ b/mason.configure.help
@@ -0,0 +1,127 @@
+help: |
+ This is a "morph deploy" configuration extension to fully configure
+ a Mason instance at deployment time. It uses the following variables
+ from the environment:
+
+ * TROVE_ID
+ * TROVE_HOST
+ * ARTIFACT_CACHE_SERVER
+
+ * GERRIT_USER
+ * GERRIT_HOSTNAME
+ * GERRIT_HTTP_PORT
+ * GERRIT_GIT_PORT
+ * GERRIT_SSH_KEY
+ * GERRIT_SSH_KEY_PATH
+
+ * GEARMAN_HOST
+ * GEARMAN_PORT
+ * START_GEARMAN
+
+ * MASON_CLUSTER_MORPHOLOGY
+ * MASON_ARCHITECTURE
+ * MASON_TEST_HOSTS
+ * MASON_DISTBUILD_CONTROLLERS
+ * MASON_TEST_INFRASTRUCTURE_TYPE
+ * MASON_UPSTREAM_TROVE
+
+ * MASON_OPENSTACK_NETWORK_ID
+ * MASON_OPENSTACK_USER
+ * MASON_OPENSTACK_PASSWORD
+ * MASON_OPENSTACK_TENANT_ID
+ * MASON_OPENSTACK_TENANT_NAME
+ * MASON_OPENSTACK_AUTH_URL
+
+ The variables are described in more detail below.
+
+ A Mason deployment needs to know the following things:
+
+ * The ID and public name of the upstream Trove it should
+ use with morph.
+ * The hostname of the Gerrit instance to be monitored.
+ * A username to use on the Gerrit instance to be monitored,
+ and an ssh key with which to authenticate.
+
+ These, amongst some other configuration for Mason, are provided
+ by the variables described in this help.
+
+ * TROVE_ID: the same as for distbuild, this is the short ID of
+ your upstream Trove.
+ * TROVE_HOST: the same as for distbuild, this is the FQDN or
+ IP address of your upstream Trove.
+ * ARTIFACT_CACHE_SERVER: this is the FQDN or IP address of the
+ artifact cache you wish to use - normally the same as
+ TROVE_HOST.
+
+ * GERRIT_USER: the username of the Gerrit account Zuul should
+ use to look for and report on changes.
+ * GERRIT_HOSTNAME: the FQDN or IP address of the Gerrit instance
+ to be used.
+ * GERRIT_HTTP_PORT: the port used to access the HTTP frontend of
+ Gerrit - normally 8080.
+ * GERRIT_GIT_PORT: the port used to access Gerrit's git interface
+ (and via SSH) - normally 29418.
+ * GERRIT_SSH_KEY: the location of the SSH key to be added to the
+ system for use when accessing Gerrit. If this is not the same
+ WORKER_SSH_KEY then GERRIT_SSH_KEY_PATH should *not* be
+ "/root/.ssh/id_rsa"
+ * GERRIT_SSH_KEY_PATH: the location to put the SSH key for Gerrit
+ in the system. Normally, "/root/.ssh/id_rsa" is sufficient,
+ unless WORKER_SSH_KEY and GERRIT_SSH_KEY are not the same.
+
+ * GEARMAN_HOST: the FQDN or IP address of the Gearman server. If
+ START_GEARMAN is yes, then this should be 127.0.0.1
+ * GEARMAN_PORT: the port used for accessing the Gearman server.
+ This is normally 4730.
+ * START_GEARMAN: yes or no. If yes, then a Gearman server is run
+ on the Mason instance by Zuul.
+
+ * MASON_ARCHITECTURE: this is currently used to determine which
+ artifacts need to be uploaded. Artifacts from systems in
+ MASON_CLUSTER_MORPHOLOGY with arch: MASON_ARCHITECTURE are
+ uploaded.
+ * MASON_CLUSTER_MORPHOLOGY: this is the cluster morphology which
+ contains the systems to be tested.
+ * MASON_DISTBUILD_CONTROLLERS: this is a comma separated list of
+ pairs of the form "architecture:ip" which defines the distbuild
+ networks available for Mason. It is not used by the tests at
+ the moment however.
+ * MASON_TEST_HOSTS: this is a comma separated list of pairs of the
+ form "architecture:user@url" which defines the places to deploy
+ test systems to. If MASON_TEST_INFRASTRUCTURE_TYPE is "openstack"
+ then use your OpenStack auth URL.
+ * MASON_TEST_INFRASTRUCTURE_TYPE: this can be 'kvm' or 'openstack',
+ depending on if you are deploying your test instances to a kvm
+ host or an OpenStack cloud.
+ * MASON_UPSTREAM_TROVE: this is the Trove to which artifacts are
+ uploaded on success by Mason.
+
+ The following are only required if MASON_TEST_INFRASTRUCTURE_TYPE is
+ openstack:
+
+ * MASON_OPENSTACK_AUTH_URL: the auth url of the OpenStack instance
+ test systems are deployed to.
+ * MASON_OPENSTACK_NETWORK_ID: the network ID that test systems will
+ be connected to.
+ * MASON_OPENSTACK_USER: the username used by Mason to deploy test
+ systems with Glance.
+ * MASON_OPENSTACK_TENANT: the tenancy to deploy test systems in.
+ * MASON_OPENSTACK_PASSWORD: the password of the Mason user on
+ OpenStack. Note that this will be stored in plaintext on the
+ Mason instance. Perhaps pass this via the command line?
+
+ It is possible to deploy a generic Mason which you can then boot
+ and give configuration to at a later date:
+
+ MASON_GENERIC: yes
+
+ To configure a generic Mason, add a YAML file containing all the
+ required variables in the form at /etc/mason/mason.conf:
+
+ VARIABLE: value
+ VARIABLE: value
+ ... ...
+
+ However, you will still need to provide ARTIFACT_CACHE_SERVER,
+ TROVE_ID and TROVE_HOST as they are also used by distbuild.configure.
+
diff --git a/mason/ansible/mason-setup.yml b/mason/ansible/mason-setup.yml
index d1528dbb..66d38d81 100644
--- a/mason/ansible/mason-setup.yml
+++ b/mason/ansible/mason-setup.yml
@@ -4,7 +4,6 @@
- "/etc/mason/mason.conf"
tasks:
-
- fail: msg='TROVE_ID is mandatory'
when: TROVE_ID is not defined
@@ -14,70 +13,104 @@
- fail: msg='ARTIFACT_CACHE_SERVER is mandatory'
when: ARTIFACT_CACHE_SERVER is not defined
+ - fail: msg='GERRIT_USER is mandatory'
+ when: GERRIT_USER is not defined
+
+ - fail: msg='GERRIT_HOSTNAME is mandatory'
+ when: GERRIT_HOSTNAME is not defined
+
+ - fail: msg='GERRIT_HTTP_PORT is mandatory'
+ when: GERRIT_HTTP_PORT is not defined
+
+ - fail: msg='GERRIT_GIT_PORT is mandatory'
+ when: GERRIT_GIT_PORT is not defined
+
+ - fail: msg='GERRIT_SSH_KEY_PATH is mandatory'
+ when: GERRIT_SSH_KEY_PATH is not defined
+
+ - fail: msg='GEARMAN_HOST is mandatory'
+ when: GEARMAN_HOST is not defined
+
+ - fail: msg='GEARMAN_PORT is mandatory'
+ when: GEARMAN_PORT is not defined
+
+ - fail: msg='START_GEARMAN is mandatory'
+ when: START_GEARMAN is not defined
+
- fail: msg='MASON_CLUSTER_MORPHOLOGY is mandatory'
when: MASON_CLUSTER_MORPHOLOGY is not defined
- - fail: msg='MASON_DEFINITIONS_REF is mandatory'
- when: MASON_DEFINITIONS_REF is not defined
-
- - fail: msg='MASON_DISTBUILD_ARCH is mandatory'
- when: MASON_DISTBUILD_ARCH is not defined
+ - fail: msg='MASON_ARCHITECTURE is mandatory'
+ when: MASON_ARCHITECTURE is not defined
- - fail: msg='MASON_TEST_HOST is mandatory'
- when: MASON_TEST_HOST is not defined
+ - fail: msg='MASON_TEST_HOSTS is mandatory'
+ when: MASON_TEST_HOSTS is not defined
- - fail: msg='CONTROLLERHOST is mandatory'
- when: CONTROLLERHOST is not defined
+ - fail: msg='MASON_DISTBUILD_CONTROLLERS is mandatory'
+ when: MASON_DISTBUILD_CONTROLLERS is not defined
- - fail: msg='TEST_INFRASTRUCTURE_TYPE is mandatory'
- when: TEST_INFRASTRUCTURE_TYPE is not defined
+ - fail: msg='MASON_TEST_INFRASTRUCTURE_TYPE is mandatory'
+ when: MASON_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='MASON_UPSTREAM_TROVE is mandatory'
+ when: MASON_UPSTREAM_TROVE 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='OPENSTACK_NETWORK_ID is mandatory when MASON_TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: MASON_TEST_INFRASTRUCTURE_TYPE == "openstack" and OPENSTACK_NETWORK_ID 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_USERNAME is mandatory when MASON_TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: MASON_TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_USERNAME 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_PASSWORD is mandatory when MASON_TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: MASON_TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_PASSWORD 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_TENANT_NAME is mandatory when MASON_TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: MASON_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
+ - fail: msg='OS_AUTH_URL is mandatory when MASON_TEST_INFRASTRUCTURE_TYPE=openstack'
+ when: MASON_TEST_INFRASTRUCTURE_TYPE == "openstack" and OS_AUTH_URL is not defined
- - name: Create the Mason configuration file
+ - name: Create required configuration files
template: src=/usr/share/mason-setup/{{ item }} dest=/etc/{{ item }}
with_items:
- - mason.conf
+ - zuul.conf
+ - turbo-hipster-config.yaml
+ - lighttpd.conf
+ - zuul-layout.yaml
+ - zuul-logging.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
- - name: Restart the mason service
- service: name=mason.service state=restarted
- when: mason_service|changed
-
- - name: Enable the mason timer
- service: name=mason.timer enabled=yes
- register: mason_timer
- - name: Restart the mason timer
- service: name=mason.timer state=restarted
- when: mason_timer|changed
-
- - name: Enable the httpd service
- service: name=httpd.service enabled=yes
- register: httpd_service
- - name: Restart the httpd service
- service: name=httpd state=restarted
- when: httpd_service|changed
+ when: MASON_TEST_INFRASTRUCTURE_TYPE == "openstack"
+
+ - name: Enable the zuul-server service
+ service: name=zuul-server.service enabled=yes
+ register: zuul_server_service
+ - name: Restart the zuul-server service
+ service: name=zuul-server.service state=restarted
+ when: zuul_server_service|changed
+
+ - name: Enable the zuul-merger service
+ service: name=zuul-merger.service enabled=yes
+ register: zuul_merger_service
+ - name: Restart the zuul-merger service
+ service: name=zuul-merger.service state=restarted
+ when: zuul_merger_service|changed
+
+ - name: Enable the turbo-hipster service
+ service: name=turbo-hipster.service enabled=yes
+ register: turbo_hipster_service
+ - name: Restart the turbo-hipster service
+ service: name=turbo-hipster.service state=restarted
+ when: turbo_hipster_service|changed
+
+ - user: name=www comment="Lighttpd user"
+
+ - name: Enable the lighttpd service
+ service: name=lighttpd.service enabled=yes
+ register: lighttpd_service
+ - name: Restart the lighttpd service
+ service: name=lighttpd.service state=restarted
+ when: lighttpd_service|changed
diff --git a/mason/httpd.service b/mason/lighttpd.service
index 7572b732..ffc1b9a0 100644
--- a/mason/httpd.service
+++ b/mason/lighttpd.service
@@ -4,7 +4,7 @@ After=network.target
[Service]
User=root
-ExecStart=/usr/sbin/httpd -f -p 80 -h /srv/mason
+ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd.conf
[Install]
WantedBy=multi-user.target
diff --git a/mason/mason-generator.sh b/mason/mason-generator.sh
deleted file mode 100755
index 187db72c..00000000
--- a/mason/mason-generator.sh
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "$#" -lt 5 -o "$#" -gt 6 -o "$1" == "-h" -o "$1" == "--help" ]; then
- cat <<EOF
-Usage:
- `basename $0` HOST_PREFIX UPSTREAM_TROVE_HOSTNAME VM_USER VM_HOST VM_PATH [HOST_POSTFIX]
-
-Where:
- HOST_PREFIX -- Name of your Mason instance
- e.g. "my-mason" to produce hostnames:
- my-mason-trove and my-mason-controller
- UPSTREAM_TROVE_HOSTNAME -- Upstream trove's hostname
- VM_USER -- User on VM host for VM deployment
- VM_HOST -- VM host for VM deployment
- VM_PATH -- Path to store VM images in on VM host
- HOST_POSTFIX -- e.g. ".example.com" to get
- my-mason-trove.example.com
-
-This script makes deploying a Mason system simpler by automating
-the generation of keys for the systems to use, building of the
-systems, filling out the mason deployment cluster morphology
-template with useful values, and finally deploying the systems.
-
-To ensure that the deployed system can deploy test systems, you
-must supply an ssh key to the VM host. Do so with the following
-command:
- ssh-copy-id -i ssh_keys-HOST_PREFIX/worker.key.pub VM_USER@VM_HOST
-
-To ensure that the mason can upload artifacts to the upstream trove,
-you must supply an ssh key to the upstream trove. Do so with the
-following command:
- ssh-copy-id -i ssh_keys-HOST_PREFIX/id_rsa.key.pub root@UPSTREAM_TROVE_HOSTNAME
-
-EOF
- exit 0
-fi
-
-
-HOST_PREFIX="$1"
-UPSTREAM_TROVE="$2"
-VM_USER="$3"
-VM_HOST="$4"
-VM_PATH="$5"
-HOST_POSTFIX="$6"
-
-sedescape() {
- # Escape all non-alphanumeric characters
- printf "%s\n" "$1" | sed -e 's/\W/\\&/g'
-}
-
-
-##############################################################################
-# Key generation
-##############################################################################
-
-mkdir -p "ssh_keys-${HOST_PREFIX}"
-cd "ssh_keys-${HOST_PREFIX}"
-test -e mason.key || ssh-keygen -t rsa -b 2048 -f mason.key -C mason@TROVE_HOST -N ''
-test -e lorry.key || ssh-keygen -t rsa -b 2048 -f lorry.key -C lorry@TROVE_HOST -N ''
-test -e worker.key || ssh-keygen -t rsa -b 2048 -f worker.key -C worker@TROVE_HOST -N ''
-test -e id_rsa || ssh-keygen -t rsa -b 2048 -f id_rsa -C trove-admin@TROVE_HOST -N ''
-cd ../
-
-
-##############################################################################
-# Mason setup
-##############################################################################
-
-cp clusters/mason.morph mason-${HOST_PREFIX}.morph
-
-sed -i "s/red-box-v1/$(sedescape "$HOST_PREFIX")/g" "mason-$HOST_PREFIX.morph"
-sed -i "s/ssh_keys/ssh_keys-$(sedescape "$HOST_PREFIX")/g" "mason-$HOST_PREFIX.morph"
-sed -i "s/upstream-trove/$(sedescape "$UPSTREAM_TROVE")/" "mason-$HOST_PREFIX.morph"
-sed -i "s/vm-user/$(sedescape "$VM_USER")/g" "mason-$HOST_PREFIX.morph"
-sed -i "s/vm-host/$(sedescape "$VM_HOST")/g" "mason-$HOST_PREFIX.morph"
-sed -i "s/vm-path/$(sedescape "$VM_PATH")/g" "mason-$HOST_PREFIX.morph"
-sed -i "s/\.example\.com/$(sedescape "$HOST_POSTFIX")/g" "mason-$HOST_PREFIX.morph"
-
-
-##############################################################################
-# System building
-##############################################################################
-
-morph build systems/trove-system-x86_64.morph
-morph build systems/build-system-x86_64.morph
-
-
-##############################################################################
-# System deployment
-##############################################################################
-
-morph deploy mason-${HOST_PREFIX}.morph
-
-
-##############################################################################
-# Cleanup
-##############################################################################
-
-rm mason-${HOST_PREFIX}.morph
diff --git a/mason/mason-report.sh b/mason/mason-report.sh
deleted file mode 100755
index 9c20b65b..00000000
--- a/mason/mason-report.sh
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/bin/bash
-
-set -x
-
-. /etc/mason.conf
-
-REPORT_PATH=/var/mason/report.html
-SERVER_PATH=/srv/mason
-
-sed_escape() {
- printf "%s\n" "$1" | sed -e 's/\W/\\&/g'
-}
-
-create_report() {
-cat > $REPORT_PATH <<'EOF'
-<html>
-<head>
-<meta charset="UTF-8">
-<meta http-equiv="refresh" content="60">
-<style>
-html, body {
- margin: 0;
- padding: 0;
-}
-p.branding {
- background: black;
- color: #fff;
- padding: 0.4em;
- margin: 0;
- font-weight: bold;
-}
-h1 {
- background: #225588;
- color: white;
- margin: 0;
- padding: 0.6em;
-}
-table {
- width: 90%;
- margin: 1em auto 6em auto;
- border: 1px solid black;
- border-spacing: 0;
-}
-table tr.headings {
- background: #555;
- color: white;
-}
-table tr.pass {
- background: #aaffaa;
-}
-table tr.pass:hover {
- background: #bbffbb;
-}
-table tr.fail {
- background: #ffaaaa;
-}
-table tr.fail:hover {
- background: #ffbbbb;
-}
-table tr.nonet {
- background: #ffdd99;
-}
-table tr.nonet:hover {
- background: #ffeeaa;
-}
-table tr.headings th {
- font-weight: bold;
- text-align: left;
- padding: 3px 2px;
-}
-table td {
- padding: 2px;
-}
-td.result {
- font-weight: bold;
- text-transform: uppercase;
-}
-td.result a {
- text-decoration: none;
-}
-td.result a:before {
- content: "➫ ";
-}
-tr.pass td.result a {
- color: #252;
-}
-tr.pass td.result a:hover {
- color: #373;
-}
-tr.fail td.result a {
- color: #622;
-}
-tr.fail td.result a:hover {
- color: #933;
-}
-tr.nonet td.result a {
- color: #641;
-}
-tr.nonet td.result a:hover {
- color: #962;
-}
-td.ref {
- font-family: monospace;
-}
-td.ref a {
- color: #333;
-}
-td.ref a:hover {
- color: #555;
-}
-table tr.pass td, table tr.fail td {
- border-top: solid white 1px;
-}
-p {
- margin: 1.3em;
-}
-code {
- padding: 0.3em 0.5em;
- background: #eee;
- border: 1px solid #bbb;
- border-radius: 1em;
-}
-#footer {
- margin: 0;
- background: #aaa;
- color: #222;
- border-top: #888 1px solid;
- font-size: 80%;
- padding: 0;
- position: fixed;
- bottom: 0;
- width: 100%;
- display: table;
-}
-#footer p {
- padding: 1.3em;
- display: table-cell;
-}
-#footer p code {
- font-size: 110%;
-}
-#footer p.about {
- text-align: right;
-}
-</style>
-</head>
-<body>
-<p class="branding">Mason</p>
-<h1>Baserock: Continuous Delivery</h1>
-<p>Build log of changes to <code>BRANCH</code> from <code>TROVE</code>. Most recent first.</p>
-<table>
-<tr class="headings">
- <th>Started</th>
- <th>Ref</th>
- <th>Duration</th>
- <th>Result</th>
-</tr>
-<!--INSERTION POINT-->
-</table>
-<div id="footer">
-<p>Last checked for updates at: <code>....-..-.. ..:..:..</code></p>
-<p class="about">Generated by Mason | Powered by Baserock</p>
-</div>
-</body>
-</html>
-EOF
-
- sed -i 's/BRANCH/'"$(sed_escape "$1")"'/' $REPORT_PATH
- sed -i 's/TROVE/'"$(sed_escape "$2")"'/' $REPORT_PATH
-}
-
-update_report() {
- # Give function params sensible names
- build_start_time="$1"
- build_trove_host="$2"
- build_ref="$3"
- build_sha1="$4"
- build_duration="$5"
- build_result="$6"
-
- # Generate template if report file is not there
- if [ ! -f $REPORT_PATH ]; then
- create_report $build_ref $build_trove_host
- fi
-
- # Build table row for insertion into report file
- if [ "$build_result" = nonet ]; then
- msg='<tr class="'"${build_result}"'"><td>'"${build_start_time}"'</td><td class="ref">Failed to contact '"${build_trove_host}"'</a></td><td>'"${build_duration}s"'</td><td class="result"><a href="log/'"${build_sha1}"'--'"${build_start_time}"'.log">'"${build_result}"'</a></td></tr>'
- else
- msg='<tr class="'"${build_result}"'"><td>'"${build_start_time}"'</td><td class="ref"><a href="http://'"${build_trove_host}"'/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/commit/?h='"${build_ref}"'&id='"${build_sha1}"'">'"${build_sha1}"'</a></td><td>'"${build_duration}s"'</td><td class="result"><a href="log/'"${build_sha1}"'--'"${build_start_time}"'.log">'"${build_result}"'</a></td></tr>'
- fi
-
- # Insert report line, newest at top
- sed -i 's/<!--INSERTION POINT-->/<!--INSERTION POINT-->\n'"$(sed_escape "$msg")"'/' $REPORT_PATH
-}
-
-update_report_time() {
- # Give function params sensible names
- build_start_time="$1"
-
- # If the report file exists, update the last-checked-for-updates time
- if [ -f $REPORT_PATH ]; then
- sed -i 's/<code>....-..-.. ..:..:..<\/code>/<code>'"$(sed_escape "$build_start_time")"'<\/code>/' $REPORT_PATH
- fi
-}
-
-START_TIME=`date +%Y-%m-%d\ %T`
-
-update_report_time "$START_TIME"
-cp "$REPORT_PATH" "$SERVER_PATH/index.html"
-
-logfile="$(mktemp)"
-/usr/lib/mason/mason.sh 2>&1 | tee "$logfile"
-case "${PIPESTATUS[0]}" in
-0)
- RESULT=pass
- ;;
-33)
- RESULT=skip
- ;;
-42)
- RESULT=nonet
- ;;
-*)
- RESULT=fail
- ;;
-esac
-
-# TODO: Update page with last executed time
-if [ "$RESULT" = skip ]; then
- rm "$logfile"
- exit 0
-fi
-
-DURATION=$(( $(date +%s) - $(date --date="$START_TIME" +%s) ))
-SHA1="$(cd "ws/$DEFINITIONS_REF/$UPSTREAM_TROVE_ADDRESS/baserock/baserock/definitions" && git rev-parse HEAD)"
-
-update_report "$START_TIME" \
- "$UPSTREAM_TROVE_ADDRESS" \
- "$DEFINITIONS_REF" \
- "$SHA1" \
- "$DURATION" \
- "$RESULT"
-
-
-#
-# Copy report into server directory
-#
-
-cp "$REPORT_PATH" "$SERVER_PATH/index.html"
-mkdir "$SERVER_PATH/log"
-mv "$logfile" "$SERVER_PATH/log/$SHA1--$START_TIME.log"
diff --git a/mason/mason.service b/mason/mason.service
deleted file mode 100644
index a864d610..00000000
--- a/mason/mason.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Mason: Continuous Delivery Service
-After=mason-setup.service
-
-[Service]
-User=root
-ExecStart=/usr/lib/mason/mason-report.sh
-
-[Install]
-WantedBy=multi-user.target
diff --git a/mason/mason.sh b/mason/mason.sh
deleted file mode 100755
index dba99dfa..00000000
--- a/mason/mason.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/bin/sh
-
-# Load OpenStack credentials
-if [ -f "/etc/os.conf" ]; then
- . /etc/os.conf
-fi
-
-set -e
-set -x
-
-# Load our deployment config
-. /etc/mason.conf
-
-if [ ! -e ws ]; then
- morph init ws
-fi
-cd ws
-
-definitions_repo="$DEFINITIONS_REF"/"$UPSTREAM_TROVE_ADDRESS"/baserock/baserock/definitions
-if [ ! -e "$definitions_repo" ]; then
- morph checkout git://"$UPSTREAM_TROVE_ADDRESS"/baserock/baserock/definitions "$DEFINITIONS_REF"
- cd "$definitions_repo"
- git config user.name "$TROVE_ID"-mason
- git config user.email "$TROVE_ID"-mason@$(hostname)
-else
- cd "$definitions_repo"
- SHA1_PREV="$(git rev-parse HEAD)"
-fi
-
-if ! git remote update origin; then
- echo ERROR: Unable to contact trove
- exit 42
-fi
-git clean -fxd
-git reset --hard origin/"$DEFINITIONS_REF"
-
-SHA1="$(git rev-parse HEAD)"
-
-if [ -f "$HOME/success" ] && [ "$SHA1" = "$SHA1_PREV" ]; then
- echo INFO: No changes to "$DEFINITIONS_REF", nothing to do
- exit 33
-fi
-
-rm -f "$HOME/success"
-
-echo INFO: Mason building: $DEFINITIONS_REF at $SHA1
-
-if ! "scripts/release-build" --no-default-configs \
- --trove-host "$UPSTREAM_TROVE_ADDRESS" \
- --artifact-cache-server "http://$ARTIFACT_CACHE_SERVER:8080/" \
- --controllers "$DISTBUILD_ARCH:$DISTBUILD_CONTROLLER_ADDRESS" \
- "$BUILD_CLUSTER_MORPHOLOGY"; then
- echo ERROR: Failed to build release images
- echo Build logs for chunks:
- find builds -type f -exec echo {} \; -exec cat {} \;
- exit 1
-fi
-
-releases_made="$(cd release && ls | wc -l)"
-if [ "$releases_made" = 0 ]; then
- echo ERROR: No release images created
- exit 1
-else
- echo INFO: Created "$releases_made" release images
-fi
-
-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" \
- --log-level=debug --log="$HOME"/release-upload.log \
- --public-trove-host "$UPSTREAM_TROVE_ADDRESS" \
- --public-trove-username root \
- --public-trove-artifact-dir /home/cache/artifacts \
- --no-upload-release-artifacts \
- "$BUILD_CLUSTER_MORPHOLOGY"
-
-echo INFO: Artifact upload complete for $DEFINITIONS_REF at $SHA1
-
-touch "$HOME/success"
diff --git a/mason/mason.timer b/mason/mason.timer
deleted file mode 100644
index 107dff97..00000000
--- a/mason/mason.timer
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Runs Mason continually with 1 min between calls
-
-[Timer]
-#Time between Mason finishing and calling it again
-OnUnitActiveSec=1min
-Unit=mason.service
-
-[Install]
-WantedBy=multi-user.target
diff --git a/mason/share/lighttpd.conf b/mason/share/lighttpd.conf
new file mode 100644
index 00000000..2e9f6350
--- /dev/null
+++ b/mason/share/lighttpd.conf
@@ -0,0 +1,21 @@
+server.document-root = "/var/www/"
+
+server.port = 80
+
+server.username = "www"
+server.groupname = "www"
+
+mimetype.assign = (
+ ".html" => "text/html",
+ ".txt" => "text/plain",
+ ".log" => "text/plain",
+ ".jpg" => "image/jpeg",
+ ".png" => "image/png"
+)
+
+static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" )
+index-file.names = ( "index.html" )
+
+$HTTP["url"] =~ "^/logs/" {
+ dir-listing.activate = "enable"
+}
diff --git a/mason/share/mason.conf b/mason/share/mason.conf
deleted file mode 100644
index 1295ce84..00000000
--- a/mason/share/mason.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-# This file is generarated by the mason-setup systemd unit.
-# If you want to change the configuration, change the configuration
-# in /etc/mason/mason.conf and restart the service.
-
-ARTIFACT_CACHE_SERVER={{ ARTIFACT_CACHE_SERVER|quote }}
-UPSTREAM_TROVE_ADDRESS={{ TROVE_HOST|quote }}
-DEFINITIONS_REF={{ MASON_DEFINITIONS_REF|quote }}
-DISTBUILD_ARCH={{ MASON_DISTBUILD_ARCH|quote }}
-DISTBUILD_CONTROLLER_ADDRESS={{ CONTROLLERHOST|quote }}
-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 }}
-{% if OPENSTACK_NETWORK_ID is defined %}OPENSTACK_NETWORK_ID={{ OPENSTACK_NETWORK_ID|quote }}{% endif %}
diff --git a/mason/share/os.conf b/mason/share/os.conf
index 21ef398c..1acfff79 100644
--- a/mason/share/os.conf
+++ b/mason/share/os.conf
@@ -18,7 +18,6 @@ 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
diff --git a/mason/share/turbo-hipster-config.yaml b/mason/share/turbo-hipster-config.yaml
new file mode 100644
index 00000000..8ae8133d
--- /dev/null
+++ b/mason/share/turbo-hipster-config.yaml
@@ -0,0 +1,47 @@
+zuul_server:
+ gerrit_site: "http://{{ GERRIT_HOSTNAME }}:{{ GERRIT_HTTP_PORT }}"
+ git_origin: "git://{{ GERRIT_HOSTNAME }}:{{ GERRIT_GIT_PORT }}"
+ gearman_host: "{{ GEARMAN_HOST }}"
+ gearman_port: "{{ GEARMAN_PORT }}"
+
+debug_log: /var/log/turbo-hipster/debug.log
+jobs_working_dir: /var/lib/turbo-hipster/jobs
+git_working_dir: /var/lib/turbo-hipster/git
+pip_download_cache: /var/cache/pip
+
+plugins:
+ - name: build
+ function: build:build
+ import-path: mason.tests.build
+ location: /usr/share/system-tests/
+ config:
+ trove-host: "{{ TROVE_HOST }}"
+ artifact-cache-server: "{{ ARTIFACT_CACHE_SERVER }}"
+ controllers: [ "{{ MASON_DISTBUILD_CONTROLLERS }}" ]
+ cluster-morphology: "{{ MASON_CLUSTER_MORPHOLOGY }}"
+ - name: build-test
+ function: build:build_test
+ import-path: mason.tests.build_test
+ location: /usr/share/system-tests/
+ config:
+ trove-host: "{{ TROVE_HOST }}"
+ cluster-morphology: "{{ MASON_CLUSTER_MORPHOLOGY }}"
+ test-infrastructure-type: "{{ MASON_TEST_INFRASTRUCTURE_TYPE }}"
+ deployment-host: [ "{{ MASON_TEST_HOSTS }}" ]
+ trove-id: "{{ TROVE_ID }}"
+ openstack-network-id: "{{ OPENSTACK_NETWORK_ID }}"
+ - name: artifact-upload
+ function: build:artifact_upload
+ import-path: mason.tests.artifact_upload
+ location: /usr/share/system-tests/
+ config:
+ artifact-cache-server: "{{ ARTIFACT_CACHE_SERVER }}"
+ cluster-morphology: "{{ MASON_CLUSTER_MORPHOLOGY }}"
+ architecture: "{{ MASON_ARCHITECTURE }}"
+ upstream-trove: "{{ MASON_UPSTREAM_TROVE }}"
+ upload-release-artifacts: False
+
+publish_logs:
+ type: local
+ path: /var/log/
+ prepend_url: http://localhost/logs
diff --git a/mason/share/zuul-layout.yaml b/mason/share/zuul-layout.yaml
new file mode 100644
index 00000000..a845a62f
--- /dev/null
+++ b/mason/share/zuul-layout.yaml
@@ -0,0 +1,22 @@
+pipelines:
+ - name: check
+ manager: IndependentPipelineManager
+ trigger:
+ gerrit:
+ - event: patchset-created
+ success:
+ gerrit:
+ verified: 1
+ failure:
+ gerrit:
+ verified: -1
+
+jobs:
+ - name: ^.*-merge$
+ failure-message: Unable to merge change, please rebase and try again.
+
+projects:
+ - name: baserock/baserock/definitions
+ check:
+ - build:
+ - build_test
diff --git a/mason/share/zuul-logging.conf b/mason/share/zuul-logging.conf
new file mode 100644
index 00000000..8b76da26
--- /dev/null
+++ b/mason/share/zuul-logging.conf
@@ -0,0 +1,44 @@
+[loggers]
+keys=root,zuul,gerrit
+
+[handlers]
+keys=console,debug,normal
+
+[formatters]
+keys=simple
+
+[logger_root]
+level=WARNING
+handlers=console
+
+[logger_zuul]
+level=DEBUG
+handlers=debug,normal
+qualname=zuul
+
+[logger_gerrit]
+level=DEBUG
+handlers=debug,normal
+qualname=gerrit
+
+[handler_console]
+level=WARNING
+class=StreamHandler
+formatter=simple
+args=(sys.stdout,)
+
+[handler_debug]
+level=DEBUG
+class=logging.handlers.TimedRotatingFileHandler
+formatter=simple
+args=('/var/log/zuul/debug.log', 'midnight', 1, 30,)
+
+[handler_normal]
+level=INFO
+class=logging.handlers.TimedRotatingFileHandler
+formatter=simple
+args=('/var/log/zuul/zuul.log', 'midnight', 1, 30,)
+
+[formatter_simple]
+format=%(asctime)s %(levelname)s %(name)s: %(message)s
+datefmt=
diff --git a/mason/share/zuul.conf b/mason/share/zuul.conf
new file mode 100644
index 00000000..21066e70
--- /dev/null
+++ b/mason/share/zuul.conf
@@ -0,0 +1,26 @@
+[gearman]
+server={{ GEARMAN_HOST }}
+port={{ GEARMAN_PORT }}
+
+[gearman_server]
+start={{ START_GEARMAN }}
+
+[gerrit]
+server={{ GERRIT_HOSTNAME }}
+port={{ GERRIT_GIT_PORT }}
+baseurl=http://{{ GERRIT_HOSTNAME }}:{{ GERRIT_HTTP_PORT }}
+user={{ GERRIT_USER }}
+sshkey={{ GERRIT_SSH_KEY_PATH }}
+
+[zuul]
+log_config=/etc/zuul-logging.conf
+pidfile=/var/run/zuul/zuul.pid
+state_dir=/var/lib/zuul
+git_dir=/var/lib/zuul/git
+status_url=http://127.0.0.1/logs
+
+[merger]
+git_dir=/var/lib/zuul/git
+git_user_email={{ GERRIT_USER }}@mason
+git_user_name={{ GERRIT_USER }}
+zuul_url=ssh://{{ GERRIT_USER }}@{{ GERRIT_HOSTNAME }}:{{ GERRIT_GIT_PORT }}
diff --git a/mason/ssh-config b/mason/ssh-config
new file mode 100644
index 00000000..f30d239b
--- /dev/null
+++ b/mason/ssh-config
@@ -0,0 +1,2 @@
+Host *
+ StrictHostKeyChecking no
diff --git a/mason/turbo-hipster.service b/mason/turbo-hipster.service
new file mode 100644
index 00000000..20cde2ad
--- /dev/null
+++ b/mason/turbo-hipster.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=turbo-hipster: Test runner for Zuul
+After=zuul-server.service
+
+[Service]
+User=root
+ExecStart=/bin/sh -c ". /etc/os.conf && /usr/bin/turbo-hipster -c /etc/turbo-hipster-config.yaml"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mason/zuul-merger.service b/mason/zuul-merger.service
new file mode 100644
index 00000000..a3aa0ca5
--- /dev/null
+++ b/mason/zuul-merger.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Zuul Merger: Handles automated merging of changes
+After=zuul-server.service
+
+[Service]
+User=root
+ExecStart=/usr/bin/zuul-merger -d -c /etc/zuul.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/mason/zuul-server.service b/mason/zuul-server.service
new file mode 100644
index 00000000..dfc6436f
--- /dev/null
+++ b/mason/zuul-server.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Zuul: CI orchestration and Gatekeeper
+After=mason-setup.service
+
+[Service]
+User=root
+ExecStart=/usr/bin/zuul-server -d -c /etc/zuul.conf -l /etc/zuul-layout.yaml
+
+[Install]
+WantedBy=multi-user.target