-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·80 lines (53 loc) · 1.43 KB
/
install.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
#!/bin/bash
###########################################################
######### functions
###########################################################
banner (){
echo "###########################################################"
echo "$1 configuraton is started"
echo "###########################################################"
}
ubuntu20_config () {
banner Ubuntu20
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt-get install -y ansible
ansible-playbook ubuntu20/ubuntu20.yaml -i ubuntu20/inventory
exit
}
ubuntu18_config () {
banner Ubuntu18
exit
}
redhat8_config () {
banner Redhat8
exit
}
select_os (){
PS3='What is your Opration System? choose one of the options please ?
'
options=("ubuntu 18" "ubuntu 20" "redhat 8" "Quit")
select opt in "${options[@]}"
do
case $opt in
"ubuntu 18")
ubuntu18_config
;;
"redhat 8")
redhat8_config
;;
"ubuntu 20")
ubuntu20_config
;;
"Quit")
break
;;
*) echo "invalid option $REPLY Please try again";;
esac
done
}
###########################################################
######### start from here
###########################################################
# first we need to know about os and call the appropriate function.
select_os