-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathinit.sh
executable file
·70 lines (59 loc) · 1.92 KB
/
init.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
# Initializes the Red Hat JBoss middleware SOE
#set -x
CURRENT=$(pwd)
IS_NEXUS=false
IS_TOWER=false
for var in "$@"
do
case $var in
"nexus")
IS_NEXUS=true
;;
"tower")
IS_TOWER=true
;;
esac
done
echo " >>> Retrieve required Ansible roles"
ansible-galaxy install -r roles/requirements.yml -p roles --force
echo " >>> Prepare locale file structure, build applications and golden images"
ansible-playbook local.yml
# Backup and removes the ssh known_hosts (prevents issues with ssh)
mv -n ~/.ssh/known_hosts{,_$(date +%s).orig}
echo " >>> Create and start the virtual machine(s)"
cd ${CURRENT}/vagrant
vagrant up host-dev-01
vagrant up host-dev-02
vagrant up host-dev-03
if $IS_NEXUS; then
vagrant up nexus
fi
if $IS_TOWER ; then
vagrant up tower
else
echo " >>> Provision the virtual machine(s) with ansible"
cd ${CURRENT}
ansible-playbook site.yml
fi
if $IS_TOWER ; then
echo "================================================================================="
echo " Congratulations, you just prepared your Red Hat JBoss middleware successfully!"
echo " "
echo " To provision your virtual machines, please log into Ansible Tower (https://192.168.0.200/)"
echo " using the previously displayed user and password."
echo " "
echo "================================================================================="
else
echo "================================================================================="
echo " Congratulations, you just setup your Red Hat JBoss middleware successfully!"
echo " "
echo " Check the running applications here:"
echo " http://192.168.0.101/ticket-monster/"
echo " http://192.168.0.101/petclinic/"
echo " http://192.168.0.101/jenkins/"
echo " "
echo " Execute this command for running Ansible again:"
echo " $ ansible-playbook site.yml"
echo "================================================================================="
fi