forked from metal3-io/metal3-dev-env
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcentos_install_requirements.sh
More file actions
executable file
·122 lines (107 loc) · 3.19 KB
/
centos_install_requirements.sh
File metadata and controls
executable file
·122 lines (107 loc) · 3.19 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env bash
set -ex
# shellcheck disable=SC1091
source lib/logging.sh
# shellcheck disable=SC1091
source lib/common.sh
sudo yum install -y libselinux-utils
if selinuxenabled ; then
sudo setenforce permissive
sudo sed -i "s/=enforcing/=permissive/g" /etc/selinux/config
fi
# Update to latest packages first
sudo yum -y update
# Install EPEL required by some packages
if [ ! -f /etc/yum.repos.d/epel.repo ] ; then
if grep -q "Red Hat Enterprise Linux" /etc/redhat-release ; then
sudo yum -y install http://mirror.centos.org/centos/7/extras/x86_64/Packages/epel-release-7-11.noarch.rpm
else
sudo yum -y install epel-release --enablerepo=extras
fi
fi
# Install required packages
# python-{requests,setuptools} required for tripleo-repos install
sudo yum -y install \
crudini \
curl \
dnsmasq \
figlet \
golang \
NetworkManager \
nmap \
patch \
psmisc \
python-pip \
python-requests \
python-setuptools \
vim-enhanced \
wget
# We're reusing some tripleo pieces for this setup so clone them here
cd
if [ ! -d tripleo-repos ]; then
git clone https://git.openstack.org/openstack/tripleo-repos
fi
pushd tripleo-repos
sudo -E python setup.py install
popd
# Needed to get a recent python-virtualbmc package
sudo -E tripleo-repos current-tripleo
# There are some packages which are newer in the tripleo repos
sudo yum -y update
# make sure additional requirments are installed
sudo yum -y install \
ansible \
bind-utils \
jq \
libguestfs-tools \
libvirt \
libvirt-devel \
libvirt-daemon-kvm \
nodejs \
python-ironicclient \
python-ironic-inspector-client \
python-lxml \
python-netaddr \
python-openstackclient \
python-virtualbmc \
qemu-kvm \
redhat-lsb-core \
virt-install \
unzip \
genisoimage
if [[ "${CONTAINER_RUNTIME}" == "podman" ]]; then
sudo yum -y install podman
else
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
fi
# Install python packages not included as rpms
sudo -E pip install \
lolcat \
yq
if ! which minikube 2>/dev/null ; then
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/.
fi
if ! which docker-machine-driver-kvm2 2>/dev/null ; then
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2
chmod +x docker-machine-driver-kvm2
sudo mv docker-machine-driver-kvm2 /usr/local/bin/.
fi
if ! which kubectl 2>/dev/null ; then
curl -LO https://storage.googleapis.com/kubernetes-release/release/"$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)"/bin/linux/amd64/kubectl
chmod +x kubectl
sudo mv kubectl /usr/local/bin/.
fi
if ! which kustomize 2>/dev/null ; then
curl -Lo kustomize "$(curl --silent -L https://github.com/kubernetes-sigs/kustomize/releases/latest 2>&1 | awk -F'"' '/linux_amd64/ { print "https://github.com"$2; exit }')"
chmod +x kustomize
sudo mv kustomize /usr/local/bin/.
fi