Skip to content

Commit 299872a

Browse files
anoopcs9mergify[bot]
authored andcommitted
images/ad-server: Prepare for building CentOS based images
Nightly builds of Samba on CentOS 9 contains AD DC components. Thus we could create images with those nightly builds based on CentOS. Therefore make changes accordingly in the install scripts. Signed-off-by: Anoop C S <[email protected]>
1 parent 93d1c46 commit 299872a

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

images/ad-server/install-packages.sh

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,46 @@ get_custom_repo() {
66
url="$1"
77
fname="$(basename "$url")"
88
dest="/etc/yum.repos.d/${fname}"
9-
dnf install --setopt=install_weak_deps=False -y curl
9+
dnf install --setopt=install_weak_deps=False -y /usr/bin/curl
1010
curl -L "$url" -o "$dest"
1111
}
1212

1313
install_packages_from="$1"
1414
samba_version_suffix="$2"
1515
install_custom_repo="$3"
16+
17+
# shellcheck disable=SC1091
18+
OS_BASE="$(. /etc/os-release && echo "${ID}")"
19+
1620
case "${install_packages_from}" in
1721
samba-nightly)
1822
# unset version suffix for nightly builds
1923
samba_version_suffix=""
20-
get_custom_repo "https://artifacts.ci.centos.org/samba/pkgs/master/fedora/samba-nightly-master.repo"
24+
get_custom_repo "https://artifacts.ci.centos.org/samba/pkgs/master/${OS_BASE}/samba-nightly-master.repo"
2125
;;
2226
custom-repo)
2327
get_custom_repo "${install_custom_repo}"
2428
;;
2529
esac
2630

27-
dnf install --setopt=install_weak_deps=False -y \
31+
dnf_cmd=(dnf)
32+
if [[ "${OS_BASE}" = centos ]]; then
33+
dnf install -y epel-next-release
34+
dnf_cmd+=(--enablerepo=crb)
35+
fi
36+
37+
packages=(\
2838
findutils \
2939
python-pip \
3040
python3-samba \
3141
python3-pyxattr \
3242
tdb-tools \
3343
"samba-dc${samba_version_suffix}" \
3444
procps-ng \
35-
/usr/bin/smbclient
45+
/usr/bin/smbclient)
46+
"${dnf_cmd[@]}" \
47+
install --setopt=install_weak_deps=False -y \
48+
"${packages[@]}"
3649
dnf clean all
3750

3851
rm -rf /etc/samba/smb.conf

0 commit comments

Comments
 (0)