Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
cb5e23d7
Commit
cb5e23d7
authored
8 years ago
by
Michael Schurter
Browse files
Options
Download
Email Patches
Plain Diff
Fix `vagrant provision` with a bunch of guards
parent
917c48a8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Vagrantfile
+27
-17
Vagrantfile
scripts/install_consul.sh
+8
-3
scripts/install_consul.sh
scripts/install_rkt.sh
+2
-2
scripts/install_rkt.sh
scripts/install_rkt_vagrant.sh
+6
-3
scripts/install_rkt_vagrant.sh
scripts/install_vault.sh
+8
-3
scripts/install_vault.sh
with
51 additions
and
28 deletions
+51
-28
Vagrantfile
+
27
-
17
View file @
cb5e23d7
...
...
@@ -8,17 +8,19 @@ DEFAULT_CPU_COUNT = 2
$script
=
<<
SCRIPT
GO_VERSION="1.7.5"
export DEBIAN_FRONTEND=noninteractive
sudo dpkg --add-architecture i386
sudo apt-get update
# Install base dependencies
sudo apt-get install -y build-essential curl git-core mercurial bzr \
libpcre3-dev pkg-config zip default-jre qemu silversearcher-ag
jq htop
\
vim unzip tree \
liblxc1 lxc-dev lxc-templates
\
# lxc
gcc-5-aarch64-linux-gnu binutils-aarch64-linux-gnu
\
# arm64
libc6-dev-i386 linux-libc-dev:i386
\
# i386
gcc-5-arm-linux-gnueabi gcc-5-multilib-arm-linux-gnueabi binutils-arm-linux-gnueabi
# arm
sudo
DEBIAN_FRONTEND=noninteractive
apt-get install -y build-essential curl git-core mercurial bzr \
libpcre3-dev pkg-config zip default-jre qemu silversearcher-ag \
jq htop
vim unzip tree
\
liblxc1 lxc-dev lxc-templates \
gcc-5-aarch64-linux-gnu binutils-aarch64-linux-gnu \
libc6-dev-i386 linux-libc-dev:i386 \
gcc-5-arm-linux-gnueabi gcc-5-multilib-arm-linux-gnueabi binutils-arm-linux-gnueabi
# Setup go, for development of Nomad
SRCROOT="/opt/go"
...
...
@@ -28,12 +30,16 @@ SRCPATH="/opt/gopath"
ARCH=`uname -m | sed 's|i686|386|' | sed 's|x86_64|amd64|'`
# Install Go
cd /tmp
wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${ARCH}.tar.gz
tar -xf go${GO_VERSION}.linux-${ARCH}.tar.gz
sudo mv go $SRCROOT
sudo chmod 775 $SRCROOT
sudo chown ubuntu:ubuntu $SRCROOT
if [[ $(go version) == "go version go${GO_VERSION} linux/${ARCH}" ]]; then
echo "Go ${GO_VERSION} ${ARCH} already installed; Skipping"
else
cd /tmp
wget -q https://storage.googleapis.com/golang/go${GO_VERSION}.linux-${ARCH}.tar.gz
tar -xf go${GO_VERSION}.linux-${ARCH}.tar.gz
sudo mv go $SRCROOT
sudo chmod 775 $SRCROOT
sudo chown ubuntu:ubuntu $SRCROOT
fi
# Setup the GOPATH; even though the shared folder spec gives the working
# directory the right user/group, we need to set it properly on the
...
...
@@ -52,10 +58,14 @@ sudo chmod 0755 /etc/profile.d/gopath.sh
source /etc/profile.d/gopath.sh
# Install Docker
echo deb https://apt.dockerproject.org/repo ubuntu-`lsb_release -c | awk '{print $2}'` main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-get update
sudo apt-get install -y docker-engine
if [[ -f /etc/apt/sources.list.d/docker.list ]]; then
echo "Docker repository already installed; Skipping"
else
echo deb https://apt.dockerproject.org/repo ubuntu-`lsb_release -c | awk '{print $2}'` main | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-get update
fi
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y docker-engine
# Restart docker to make sure we get the latest version of the daemon if there is an upgrade
sudo service docker restart
...
...
This diff is collapsed.
Click to expand it.
scripts/install_consul.sh
+
8
-
3
View file @
cb5e23d7
#!/bin/bash
set
-e
x
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
...
...
This diff is collapsed.
Click to expand it.
scripts/install_rkt.sh
+
2
-
2
View file @
cb5e23d7
#!/bin/bash
set
-e
x
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
...
...
This diff is collapsed.
Click to expand it.
scripts/install_rkt_vagrant.sh
+
6
-
3
View file @
cb5e23d7
#!/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
This diff is collapsed.
Click to expand it.
scripts/install_vault.sh
+
8
-
3
View file @
cb5e23d7
#!/bin/bash
set
-e
x
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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help