forked from sahilk25/bloomstack_provision
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
108 lines (91 loc) · 2.51 KB
/
install.sh
File metadata and controls
108 lines (91 loc) · 2.51 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash
read_mysql_pass () {
read -p 'Set New mysql root password: ' MYSQL_ROOT_PASS
read -p 're-enter mysql root password: ' MYSQL_ROOT_PASS1
}
read_BENCH_NAME() {
read -p 'Name of the bench: ' BENCH_NAME
}
read_production_mode() {
read -p 'Do you want to setup bench on production (y/n): ' PRODUCTION_MODE
}
read_ENABLE_SWAP() {
read -p 'Do you want to Enable SWAP 4GB (y/n): ' ENABLE_SWAP
}
read_DOCKER_SETUP() {
read -p 'Do you want to install mariadb and redis via Docker (y/n): ' DOCKER_SETUP
}
read_mysql_pass
if [ $MYSQL_ROOT_PASS = $MYSQL_ROOT_PASS1 ]
then
echo "mysql root password is set"
else
echo "password dont match"
read_mysql_pass
fi
echo "=============================================="
echo ""
read_DOCKER_SETUP
if [ $DOCKER_SETUP = 'y' ]
then
echo "mariadb and redis Docker install"
DOCKER_SETUP='1'
elif [ $DOCKER_SETUP = 'n' ]
then
echo "mariadb and redis normal install"
DOCKER_SETUP='0'
else
echo "please give ans in y or n"
read_DOCKER_SETUP
fi
echo "=============================================="
echo "=============================================="
read_BENCH_NAME
if [ -z "$BENCH_NAME" ]
then
echo "Directory name cant be Empty $BENCH_NAME"
read_BENCH_NAME
else
echo "Bench directory will be $BENCH_NAME"
fi
echo "=============================================="
echo ""
read_production_mode
echo "=============================================="
echo ""
if [ $PRODUCTION_MODE = 'y' ]
then
echo "Will set bench on production"
PRODUCTION_MODE='1'
elif [ $PRODUCTION_MODE = 'n' ]
then
echo "Bench will be setup as dev mode"
PRODUCTION_MODE='0'
else
echo "please give ans in y or n"
read_production_mode
fi
read_ENABLE_SWAP
echo "=============================================="
echo ""
if [ $ENABLE_SWAP = 'y' ]
then
echo "Will enable swap 4GB"
ENABLE_SWAP='1'
elif [ $ENABLE_SWAP = 'n' ]
then
echo "will NOT setup swap"
ENABLE_SWAP='0'
else
echo "please give ans in y or n"
read_ENABLE_SWAP
fi
apt update -y
apt install python3-pip python3-setuptools git cowsay file -y
pip3 install --upgrade pip
python3 -m easy_install --upgrade pyOpenSSL
pip3 install ansible PyMySQL redis
git clone https://github.com/sahilk25/bloomstack_provision.git
cd bloomstack_provision
cowsay -f tux starting ansible script~
ansible-playbook bench.yaml -vv -e mysql_root_pass=$MYSQL_ROOT_PASS -e bench_name=$BENCH_NAME -e production_mode=$PRODUCTION_MODE -e enable_swap=$ENABLE_SWAP -e docker_setup=$DOCKER_SETUP