-
Notifications
You must be signed in to change notification settings - Fork 11
/
ci-update-yum
executable file
·275 lines (253 loc) · 6.35 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
#!/bin/citbash
# ENTRY POINT (old / done)
set -e
source $CITHOME/ci-update-libs
$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
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*)
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
case "${NODE_NAME}" in
centos-10-*)
EXTRAOPTS="--nobest"
;;
rhel-9*)
yum -y module enable ruby:3.1
required_pkg python3.12
required_pkg python3.12-devel
required_pkg python3.12-wheel
required_pkg python3.12-cryptography
required_pkg python3.12-lxml
required_pkg python3.12-flit-core
required_pkg python3.12-pip
required_pkg python3.12-setuptools
;;
esac
yum -y $EXTRAOPTS update $POSTOPTS
optional_pkg libcgroup-devel
optional_pkg libservicelog-devel
optional_pkg python3-google-api-client
case "${NODE_NAME}" in
centos*|rhel*|anvil-ci-centos*|anvil-ci-rhel*|anvil-ci-alma*)
required_pkg platform-python-devel
;;
esac
case "${NODE_NAME}" in
anvil-ci*)
required_pkg fence-agents-common
required_pkg resource-agents
required_pkg selinux-policy-devel
;;
esac
# rust bindings
if [ -n "$RUSTBINDINGS" ] && [ "$RUSTBINDINGS" = yes ]; then
required_pkg bindgen
required_pkg clippy
required_pkg rustfmt
fi
# shellcheck for resource-agents ci/build.sh
case "${NODE_NAME}" in
fedora*)
required_pkg ShellCheck
;;
esac
# annobin-annocheck is off sync on rhel-8 power
case "${NODE_NAME}" in
*power*)
;;
*)
required_pkg annobin-annocheck
;;
esac
# rhel-9 language pack
case "${NODE_NAME}" in
*rhel-9*)
required_pkg glibc-all-langpacks
;;
esac
# rhel-9 boto3
case "${NODE_NAME}" in
*rhel-9*)
;;
*)
required_pkg python3-boto3
;;
esac
# pycurl
case "${NODE_NAME}" in
*centos-10*)
;;
*)
required_pkg python3-pycurl
;;
esac
required_pkg OpenIPMI-devel
required_pkg asciidoc
required_pkg autoconf
required_pkg automake
required_pkg bison
required_pkg byacc
required_pkg bzip2-devel
required_pkg cargo
required_pkg check-devel
required_pkg clang
required_pkg curl
required_pkg dbus-devel
required_pkg docbook-style-xsl
required_pkg doxygen
required_pkg execstack
required_pkg flex
required_pkg fontconfig
required_pkg gcc
required_pkg gettext-devel
required_pkg git
required_pkg glib2-devel
required_pkg gnutls-devel
required_pkg groff
required_pkg help2man
required_pkg inkscape
required_pkg jq
required_pkg libaio-devel
required_pkg libblkid-devel
required_pkg libcmocka-devel
required_pkg libcurl-devel
required_pkg liberation-sans-fonts
required_pkg libffi-devel
required_pkg libgcrypt-devel
required_pkg libnet-devel
required_pkg libnl3-devel
required_pkg libqb-devel
required_pkg libtool
required_pkg libtool-ltdl-devel
required_pkg libuuid-devel
required_pkg libvirt-devel
required_pkg libxml2-devel
required_pkg libxslt
required_pkg libxslt-devel
required_pkg libzstd-devel
required_pkg lksctp-tools-devel
required_pkg lz4-devel
required_pkg lzo-devel
required_pkg make
required_pkg net-snmp-devel
required_pkg ncurses-devel
required_pkg npm
required_pkg nss-devel
required_pkg nss-tools
required_pkg openssl-devel
required_pkg openwsman-python3
required_pkg overpass-fonts
required_pkg pam-devel
required_pkg perl
required_pkg python3-cryptography
required_pkg python3-dateutil
required_pkg python3-devel
required_pkg python3-httplib2
required_pkg python3-lxml
required_pkg python3-pexpect
required_pkg python3-pip
required_pkg python3-psutil
required_pkg python3-pyparsing
required_pkg python3-pyroute2
required_pkg python3-requests
required_pkg python3-rpm-macros
required_pkg python3-setuptools
required_pkg python3-setuptools_scm
required_pkg python3-suds
required_pkg python3-systemd
required_pkg python3-wheel
required_pkg psmisc
required_pkg rpm-build
required_pkg rpmdevtools
required_pkg rpmlint
required_pkg rsync
required_pkg ruby
required_pkg ruby-devel
required_pkg rubygem-bundler
required_pkg rubygems
required_pkg rust
required_pkg systemd-devel
required_pkg time
required_pkg util-linux
required_pkg valgrind
required_pkg which
required_pkg xz-devel
required_pkg zlib-devel
case "${NODE_NAME}" in
*vapor*)
required_pkg ansible
required_pkg azure-cli
required_pkg brewkoji
required_pkg createrepo
required_pkg crudini
required_pkg firewalld-filesystem
required_pkg fio
required_pkg gcc
required_pkg google-cloud-cli-minikube
required_pkg google-cloud-sdk
required_pkg jq
required_pkg kubevirt-virtctl
required_pkg libcurl-devel
required_pkg libvirt-devel
required_pkg libxml2
required_pkg nmap-ncat
required_pkg openshift-clients
required_pkg openssl-devel
required_pkg podman
required_pkg podman-docker
required_pkg pyproject-rpm-macros
required_pkg python3-colorlog
required_pkg python3-devel
required_pkg python3-openstackclient
required_pkg python3-pip
required_pkg python3-toml
required_pkg python3-vapor
required_pkg python3-wheel
required_pkg tox
;;
esac
yum -y install $REQUIRED_PKGS
for PKG in $OPTIONAL_PKGS; do yum -y install $PKG || true; done
case "${NODE_NAME}" in
*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