-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·46 lines (38 loc) · 1.16 KB
/
test.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
#!/bin/bash
set -x
set -e
# docker1 -> 192.168.122.10
# docker2 -> 192.168.122.11
# mockup -> 192.168.122.20
dockerList=(
docker1
docker2
docker3
)
certificateList=(
api.ipify.org
)
docker1Key=".vagrant/machines/docker1/libvirt/private_key"
docker1IP="192.168.122.10"
docker1User="vagrant"
docker2Key=".vagrant/machines/docker2/libvirt/private_key"
docker2IP="192.168.122.11"
docker2User="vagrant"
docker3IP="192.168.122.12"
docker3User="vagrant"
docker3Key=".vagrant/machines/docker3/libvirt/private_key"
_pwd=$PWD
tempDir=$(mktemp -d)
# Vagrant up
vagrant up
# Set infrastructure
#ansible-playbook -i vagrant-hosts.list setDocker-on-Raspberry.yml
ansible-playbook -i vagrant.py -i vagrant-groups.list setDocker-on-Raspberry.yml
#for _host in ${dockerList[@]} ; do
# # Set a single static IP
# eval ssh -i \$${_host}Key -o StrictHostKeyChecking=no \$${_host}User@\$${_host}IP \"sudo ip addr flush eth1 \; sleep 1 \; sudo systemctl restart systemd-networkd.service\"
# eval ssh -i \$${_host}Key -o StrictHostKeyChecking=no \$${_host}User@\$${_host}IP \"pgrep dhclient \&\& sudo killall dhclient \|\| echo nessun dhclient \"
#
#
#done
[ -n "$tempDir" ] && rm -rf "$tempDir"