aboutsummaryrefslogtreecommitdiff
path: root/tests/setup_RedHat.sh
diff options
context:
space:
mode:
authorSam Yaple <sam@yaple.net>2015-11-07 15:58:10 +0000
committerSam Yaple <sam@yaple.net>2015-11-22 18:34:35 +0000
commitf9ee96f21695f7eba81c07e257eda3a080108b70 (patch)
treed25de160b6b55b4f53216fda92614da8556dd6ed /tests/setup_RedHat.sh
parent4d69166e57b756f9dacdb33b304180de2ae333d5 (diff)
downloadkolla-f9ee96f21695f7eba81c07e257eda3a080108b70.tar.gz
kolla-f9ee96f21695f7eba81c07e257eda3a080108b70.zip
Convert gate to Ansible setup
To support multinode we must now distribute our setup to multiple hosts. Instead of making special rules for this, we are going to convert our existing setup to Ansible. This way both setup proceedures take place in the exact same fashion. Partially-Implements: blueprint multinode-gate Change-Id: I43ece298bba994e9b5083403ef3cf6d4245cda6d
Diffstat (limited to 'tests/setup_RedHat.sh')
-rwxr-xr-xtests/setup_RedHat.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/setup_RedHat.sh b/tests/setup_RedHat.sh
new file mode 100755
index 000000000..e9920a0da
--- /dev/null
+++ b/tests/setup_RedHat.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+set -o xtrace
+set -o errexit
+
+DEV=$1
+
+# (SamYaple)TODO: Remove the path overriding
+export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+
+cat | sudo tee /etc/yum.repos.d/docker.repo << EOF
+[docker]
+name=Docker Main Repository
+baseurl=https://yum.dockerproject.org/repo/main/centos/7
+enabled=1
+gpgcheck=1
+gpgkey=https://yum.dockerproject.org/gpg
+EOF
+
+sudo yum install -y libffi-devel openssl-devel docker-engine-1.8.2 xfsprogs
+
+# Setup backing disk for use with Docker. This is to ensure we use the ephemeral
+# disk provided to the build instance. It ensures the correct disk and storage
+# driver are used for Docker. It is recommend to use the thin provisioning
+# driver. https://github.com/docker/docker/blob/master/man/docker.1.md
+sudo parted /dev/${DEV} -s -- mklabel msdos mkpart pri 1 -1
+# Figure out the path to the partitioned device
+PARTDEV=$(ls "/dev/${DEV}"* | egrep "/dev/${DEV}p?1")
+sudo pvcreate ${PARTDEV}
+sudo vgcreate kolla01 ${PARTDEV}
+sudo lvcreate -n thin01 -L 60G kolla01
+sudo lvcreate -n thin01meta -L 2G kolla01
+yes | sudo lvconvert --type thin-pool --poolmetadata kolla01/thin01meta kolla01/thin01
+
+# Setup Docker
+sudo sed -i -r 's,(ExecStart)=(.+),\1=/usr/bin/docker daemon --storage-driver devicemapper --storage-opt dm.fs=xfs --storage-opt dm.thinpooldev=kolla01-thin01 --storage-opt dm.use_deferred_removal=true,' /usr/lib/systemd/system/docker.service
+sudo systemctl daemon-reload
+sudo systemctl start docker
+sudo docker info
+
+# disable ipv6 until we're sure routes to fedora mirrors work properly
+sudo sh -c 'echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf'
+sudo /usr/sbin/sysctl -p
+
+echo "Completed $0."