forked from mesosphere-backup/packet-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-files.sh
executable file
·42 lines (39 loc) · 1013 Bytes
/
make-files.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
#!/usr/bin/env bash
. ./ips.txt
# Make some config files
cat > config.yaml << FIN
bootstrap_url: http://$BOOTSTRAP:4040
cluster_name: $CLUSTER_NAME
exhibitor_storage_backend: zookeeper
exhibitor_zk_hosts: $BOOTSTRAP:2181
exhibitor_zk_path: /$CLUSTER_NAME
log_directory: /genconf/logs
master_discovery: static
master_list:
- $MASTER_00
- $MASTER_01
- $MASTER_02
- $MASTER_03
- $MASTER_04
resolvers:
- 8.8.4.4
- 8.8.8.8
FIN
cat > ip-detect << FIN
#!/usr/bin/env bash
set -o nounset -o errexit
export PATH=/usr/sbin:/usr/bin:\$PATH
echo \$(curl -fsSL http://169.254.169.254/latest/meta-data/public-ipv4)
FIN
# Make a script
cat > do-install.sh << FIN
#!/usr/bin/env bash
mkdir /tmp/dcos && cd /tmp/dcos
printf "Waiting for installer to appear at Bootstrap URL"
until \$(curl -m 2 --connect-timeout 2 --output /dev/null --silent --head --fail http://$BOOTSTRAP:4040/dcos_install.sh); do
sleep 1
done
curl -O http://$BOOTSTRAP:4040/dcos_install.sh
sudo bash dcos_install.sh \$1
FIN
rm -rf ./ips.txt