-
Notifications
You must be signed in to change notification settings - Fork 0
/
provision.sh
executable file
·48 lines (34 loc) · 1.22 KB
/
provision.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Update the system
apt update
apt install -y git python python-pip curl jq unzip libssl-dev gcc ruby ntp
# pip package management
pip install awscli
pip install "credstash>=1.11.0"
# gem package management
gem install librarian-puppet
# Setup the environment
echo "PATH=$PATH:/nubis-bin:/nubis-bin/nubis-builder/bin" \
| tee -a /home/ubuntu/.bashrc /root/.bashrc
echo "AWS_VAULT_BACKEND=file" \
| tee -a /home/ubuntu/.bashrc /root/.bashrc
mkdir /nubis-bin
# Add nubis-builder
git clone \
https://github.com/nubisproject/nubis-builder.git /nubis-bin/nubis-builder/
# Add Hashicorp tools
curl -L --silent -o /nubis-bin/packer.zip \
https://releases.hashicorp.com/packer/0.12.2/packer_0.12.2_linux_amd64.zip
curl -L --silent -o /nubis-bin/terraform.zip \
https://releases.hashicorp.com/terraform/0.6.16/terraform_0.6.16_linux_amd64.zip
unzip /nubis-bin/packer.zip -d /nubis-bin
unzip /nubis-bin/terraform.zip -d /nubis-bin
chmod +x /nubis-bin/packer
chmod +x /nubis-bin/terraform
# Add aws-vault
curl -L --silent -o /nubis-bin/aws-vault \
https://github.com/99designs/aws-vault/releases/download/v3.6.1/aws-vault-linux-amd64
chmod +x /nubis-bin/aws-vault
# Cleanup
rm /nubis-bin/packer.zip
rm /nubis-bin/terraform.zip