-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsummon.sh
49 lines (38 loc) · 1.03 KB
/
summon.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
#!/bin/bash
function uninstall {
echo "WARNING : This will remove all applications installed through it"
echo -n "are you sure you want to do that? [y/n] : "
read confirmation
if [ "$confirmation" == "y" ]; then
exit 0
else
echo "keeping everything intact"
exit 0
fi
}
if [ "$1" == "uninstall" ]; then
uninstall
fi
echo "=============================="
echo "Setting up your EC2 LEMP Stack"
echo "=============================="
sudo easy_install pip
sudo pip install ansible
sudo yum -y install git
echo "========================"
echo "Clone Ansible Repository"
echo "========================"
installdir="/tmp/summon-$RANDOM"
mkdir $installdir
git clone https://github.com/Quynh-Nguyen/ec2-lemp-ansible.git $installdir
if [ ! -d $installdir ]; then
echo "Failed to find Ansible EC2 LEMP Stack."
echo "git cloned failed"
exit 1
else
cd $installdir
echo "========================="
echo "Ansible Playbook Progress"
echo "========================="
ansible-playbook -i ./hosts ./site.yml --verbose
fi