forked from kronosnet/ci-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci-update-yum
executable file
·222 lines (203 loc) · 5.93 KB
/
ci-update-yum
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
#!/bin/sh
# ENTRY POINT (old / done)
set -e
$CITHOME/ci-update-common
case "${NODE_NAME}" in
rhel*)
wget --no-check-certificate -O /etc/pki/ca-trust/source/anchors/RH-IT-Root-CA.crt https://certs.corp.redhat.com/certs/Current-IT-Root-CAs.pem
wget --no-check-certificate -O /etc/pki/ca-trust/source/anchors/Eng-CA.crt https://engineering.redhat.com/Eng-CA.crt
update-ca-trust
;;
esac
yum clean all
case "${NODE_NAME}" in
centos-*|anvil-ci-centos-*|anvil-ci-almalinux-*|anvil-ci-bm*)
yum -y install epel-release
;;
rhel-8*|anvil-ci-rhel-8)
if ! rpm -qa | grep epel-release; then
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
fi
;;
rhel-9*|anvil-ci-rhel-9)
if ! rpm -qa | grep epel-release; then
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
fi
;;
esac
yum -y $EXTRAOPTS update $POSTOPTS
# handle special packages that are not available everywhere
for i in libcgroup-devel libservicelog-devel python3-google-api-client; do
yum -y install $i || true
done
EXTRADEPS=""
case "${NODE_NAME}" in
centos*|rhel*|anvil-ci-centos*|anvil-ci-rhel*|anvil-ci-alma*)
EXTRADEPS="platform-python-devel $EXTRADEPS"
;;
esac
case "${NODE_NAME}" in
anvil-ci*)
EXTRADEPS="fence-agents-common resource-agents selinux-policy-devel $EXTRADEPS"
;;
esac
# rust bindings
if [ -n "$RUSTBINDINGS" ] && [ "$RUSTBINDINGS" = yes ]; then
EXTRADEPS="bindgen clippy rustfmt $EXTRADEPS"
fi
# shellcheck for resource-agents ci/build.sh
case "${NODE_NAME}" in
fedora*)
EXTRADEPS="ShellCheck $EXTRADEPS"
;;
esac
# annobin-annocheck is off sync on rhel-8 power
case "${NODE_NAME}" in
*power*)
;;
*)
EXTRADEPS="annobin-annocheck $EXTRADEPS"
;;
esac
# rhel-9 language pack
case "${NODE_NAME}" in
*rhel-9*)
EXTRADEPS="glibc-all-langpacks $EXTRADEPS"
;;
esac
# rhel-9 boto3
case "${NODE_NAME}" in
*rhel-9*)
;;
*)
EXTRADEPS="python3-boto3 $EXTRADEPS"
;;
esac
yum -y install \
OpenIPMI-devel \
asciidoc \
autoconf \
automake \
bison \
byacc \
bzip2-devel \
cargo \
check-devel \
clang \
curl \
dbus-devel \
docbook-style-xsl \
doxygen \
execstack \
flex \
fontconfig \
gcc \
gettext-devel \
git \
glib2-devel \
gnutls-devel \
groff \
help2man \
inkscape \
jq \
libaio-devel \
libblkid-devel \
libcmocka-devel \
libcurl-devel \
liberation-sans-fonts \
libffi-devel \
libgcrypt-devel \
libnet-devel \
libnl3-devel \
libqb-devel \
libtool \
libtool-ltdl-devel \
libuuid-devel \
libvirt-devel \
libxml2-devel \
libxslt \
libxslt-devel \
libzstd-devel \
lksctp-tools-devel \
lz4-devel \
lzo-devel \
make \
net-snmp-devel \
ncurses-devel \
npm \
nss-devel \
nss-tools \
openssl-devel \
openwsman-python3 \
overpass-fonts \
pam-devel \
perl \
python3-cryptography \
python3-devel \
python3-httplib2 \
python3-lxml \
python3-pexpect \
python3-pip \
python3-pycurl \
python3-pyroute2 \
python3-requests \
python3-rpm-macros \
python3-setuptools \
python3-setuptools_scm \
python3-systemd \
python3-suds \
python3-wheel \
psmisc \
rpm-build \
rpmdevtools \
rpmlint \
rsync \
ruby \
ruby-devel \
rubygems \
rubygem-bundler \
rust \
systemd-devel \
time \
util-linux \
valgrind \
which \
xz-devel \
zlib-devel \
$EXTRADEPS
case "${NODE_NAME}" in
*vapor*)
yum -y update
yum -y install python3-devel python3-pip python3-wheel \
brewkoji createrepo ansible \
azure-cli firewalld-filesystem jq \
google-cloud-sdk python3-openstackclient \
openshift-clients kubevirt-virtctl \
google-cloud-cli-minikube podman podman-docker \
libcurl-devel libvirt-devel openssl-devel gcc \
tox crudini libxml2 nmap-ncat \
pyproject-rpm-macros python3-colorlog python3-toml \
python3-vapor
if ! which ibmcloud > /dev/null 2>&1; then
curl -fsSL https://clis.cloud.ibm.com/install/linux | sh
else
ibmcloud update -f
fi
dnf -y copr enable karmab/kcli
dnf -y install kcli
getent group kubesan >/dev/null || groupadd -r kubesan
getent passwd kubesan >/dev/null || useradd -g kubesan -G libvirt -m kubesan
setfacl -m u:kubesan:rwx /var/lib/libvirt/images
if ! grep -q enable-linger /home/kubesan/.bashrc; then
echo 'loginctl enable-linger $UID' >> /home/kubesan/.bashrc
fi
if [ ! -d /home/kubesan/.ssh ]; then
su - kubesan /bin/bash -c "mkdir -p /home/kubesan/.ssh && chmod 700 /home/kubesan/.ssh"
fi
if [ ! -f /home/kubesan/.ssh/id_rsa.pub ]; then
su - kubesan /bin/bash -c 'ssh-keygen -t rsa -b 4096 -f /home/kubesan/.ssh/id_rsa -C testing-key -N "" -q'
fi
;;
esac
getent group haclient >/dev/null || groupadd -r haclient -g 189
getent passwd hacluster >/dev/null || useradd -r -g haclient -u 189 -s /sbin/nologin -c "cluster user" hacluster