Fix vagrant provision with a bunch of guards

This commit is contained in:
Michael Schurter
2017-01-27 13:08:50 -08:00
parent 917c48a8e5
commit cb5e23d7b4
5 changed files with 51 additions and 28 deletions

View File

@@ -1,13 +1,18 @@
#!/bin/bash
set -ex
set -e
CONSUL_VERSION="0.7.2"
CONSUL_VERSION="0.7.3"
CURDIR=`pwd`
if [[ $(consul version | head -n 1 | cut -d ' ' -f 2) == "v$CONSUL_VERSION" ]]; then
echo "Consul v$CONSUL_VERSION already installed; Skipping"
exit
fi
echo Fetching Consul...
cd /tmp/
wget https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip -O consul.zip
wget -q https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip -O consul.zip
echo Installing Consul...
unzip consul.zip
sudo chmod +x consul

View File

@@ -1,6 +1,6 @@
#!/bin/bash
set -ex
set -e
RKT_VERSION="v1.18.0"
CMD="cp"
@@ -14,7 +14,7 @@ if [ ! -d "rkt-${RKT_VERSION}" ]; then
printf "rkt-%s/ doesn't exist\n" "${RKT_VERSION}"
if [ ! -f "rkt-${RKT_VERSION}.tar.gz" ]; then
printf "Fetching rkt-%s.tar.gz\n" "${RKT_VERSION}"
wget https://github.com/coreos/rkt/releases/download/$RKT_VERSION/rkt-$RKT_VERSION.tar.gz
wget -q https://github.com/coreos/rkt/releases/download/$RKT_VERSION/rkt-$RKT_VERSION.tar.gz
tar xzvf rkt-$RKT_VERSION.tar.gz
fi
fi

View File

@@ -1,8 +1,11 @@
#!/bin/bash
set -ex
set -e
# Configure rkt networking
sudo mkdir -p /etc/rkt/net.d
echo '{"name": "default", "type": "ptp", "ipMasq": false, "ipam": { "type": "host-local", "subnet": "172.16.28.0/24", "routes": [ { "dst": "0.0.0.0/0" } ] } }' | sudo tee -a /etc/rkt/net.d/99-network.conf
if [[ -f /etc/rkt/net.d/99-network.conf ]]; then
echo "rkt network already configured; Skipping"
exit
fi
echo '{"name": "default", "type": "ptp", "ipMasq": false, "ipam": { "type": "host-local", "subnet": "172.16.28.0/24", "routes": [ { "dst": "0.0.0.0/0" } ] } }' | jq . | sudo tee -a /etc/rkt/net.d/99-network.conf

View File

@@ -1,13 +1,18 @@
#!/bin/bash
set -ex
set -e
VAULT_VERSION="0.6.2"
VAULT_VERSION="0.6.4"
CURDIR=`pwd`
if [[ $(vault version | cut -d ' ' -f 2) == "v$VAULT_VERSION" ]]; then
echo "Vault v$VAULT_VERSION already installed; Skipping"
exit
fi
echo Fetching Vault ${VAULT_VERSION}...
cd /tmp/
wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip -O vault.zip
wget -q https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip -O vault.zip
echo Installing Vault...
unzip vault.zip
sudo chmod +x vault