forked from dell/omnia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprereq.sh
44 lines (38 loc) · 1.25 KB
/
prereq.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
#!/bin/bash
[ -d /opt/omnia ] || mkdir /opt/omnia
[ -d /var/log/omnia ] || mkdir /var/log/omnia
default_py_version="3.8"
validate_rocky_os="$(cat /etc/os-release | grep 'ID="rocky"' | wc -l)"
sys_py_version="$(python3 --version)"
echo "System Python version: $sys_py_version"
if [[ "$validate_rocky_os" == "1" ]];
then
echo "------------------------"
echo "INSTALLING EPEL RELEASE:"
echo "------------------------"
dnf install epel-release -y
fi
if [[ $(echo $sys_py_version | grep "3.8" | wc -l) != "1" || $(echo $sys_py_version | grep "Python" | wc -l) != "1" ]];
then
echo "----------------------"
echo "INSTALLING PYTHON 3.8:"
echo "----------------------"
dnf install python38 -y
fi
echo "--------------"
echo "UPGRADING PIP:"
echo "--------------"
pip3.8 install --upgrade pip
echo "-------------------"
echo "INSTALLING ANSIBLE:"
echo "-------------------"
python3.8 -m pip install ansible==5.10.0
selinux_count="$(grep "^SELINUX=disabled" /etc/selinux/config | wc -l)"
if [[ $selinux_count == 0 ]];
then
echo "------------------"
echo "DISABLING SELINUX:"
echo "------------------"
sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
echo "SELinux is disabled. Reboot system to notice the change in status before executing control_plane!!"
fi