-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
# When yum operates on multiple packages, it does not, by default, return an error if a subset | ||
# of packages is not found. This makes yum return an error. | ||
echo skip_missing_names_on_install=False >> /etc/yum.conf | ||
|
||
sed -i 's/\(def in_container():\)/\1\n return False/g' /usr/lib64/python*/*-packages/rhsm/config.py | ||
FOUND=false | ||
|
||
RHSM_ORG_ID=${RHSM_ORG_ID:-""} | ||
RHSM_ACTIVATION_KEY=${RHSM_ACTIVATION_KEY:-""} | ||
RHSM_USER=${RHSM_USER:-""} | ||
RHSM_PASS=${RHSM_PASS:-""} | ||
|
||
if [[ -n "${RHSM_ORG_ID}" && -n "${RHSM_ACTIVATION_KEY}" ]]; then | ||
subscription-manager register --org="${RHSM_ORG_ID}" --activationkey="${RHSM_ACTIVATION_KEY}" --force | ||
FOUND=true | ||
fi | ||
|
||
if [[ -n "${RHSM_USER}" && -n "${RHSM_PASS}" && ${FOUND} == false ]]; then | ||
subscription-manager register --username="${RHSM_USER}" --password="${RHSM_PASS}" --force | ||
FOUND=true | ||
fi | ||
|
||
if [[ ${FOUND} == false ]]; then | ||
echo "You must use subscription manager to fetch packages for redhat" | ||
exit 1 | ||
fi | ||
|
||
subscription::unregister() { | ||
subscription-manager unregister | ||
} | ||
|
||
subscription::defer_unregister() { | ||
trap subscription::unregister ABRT | ||
trap subscription::unregister EXIT | ||
trap subscription::unregister HUP | ||
trap subscription::unregister INT | ||
trap subscription::unregister TERM | ||
trap subscription::unregister USR1 | ||
trap subscription::unregister USR2 | ||
} | ||
|
||
subscription-manager release --set=8.10 | ||
subscription-manager refresh | ||
subscription::defer_unregister | ||
|
||
ENABLED_REPOS="codeready-builder-for-rhel-8-x86_64-rpms,rhel-8-for-x86_64-appstream-rpms,rhel-8-for-x86_64-baseos-rpms" | ||
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms | ||
subscription-manager repos --enable rhel-8-for-x86_64-appstream-rpms | ||
subscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms | ||
subscription-manager repos --disable=rhel-8-for-x86_64-baseos-eus-rpms --disable=rhel-8-for-x86_64-appstream-eus-rpms | ||
|
||
KUBERNETES_REPOS=${KUBERNETES_REPOS:-""} | ||
if [[ -n "${KUBERNETES_REPOS}" ]]; then | ||
ENABLED_REPOS="${ENABLED_REPOS},kubernetes" | ||
fi | ||
|
||
yum -y install gettext yum-utils createrepo dnf-utils modulemd-tools | ||
yum clean all | ||
TMP_DIR="$(mktemp -d repodata-XXXX)" | ||
chmod 777 -R "${TMP_DIR}" | ||
cp packages.txt "${TMP_DIR}" | ||
pushd "${TMP_DIR}" | ||
#shellcheck disable=SC2046,SC2062,SC2063,SC2035 | ||
repoquery --archlist=x86_64,noarch --resolve --requires --recursive $(< packages.txt) | grep -v *.i686 >> reqs.txt | ||
sed -i 1d reqs.txt # we need to get rid of the first line | ||
#shellcheck disable=SC2046 | ||
yumdownloader --archlist=x86_64,noarch \ | ||
--setopt=skip_missing_names_on_install=False -x \*i686 $(< reqs.txt) || true | ||
#shellcheck disable=SC2046 | ||
yumdownloader --setopt=skip_missing_names_on_install=False -x \*i686 --archlist=x86_64,noarch \ | ||
--resolve --disablerepo=* --enablerepo="${ENABLED_REPOS}" \ | ||
$(< packages.txt) || true | ||
|
||
rm packages.txt reqs.txt | ||
createrepo -v . | ||
repo2module . --module-name offline | ||
createrepo_mod . | ||
#shellcheck disable=SC1083,SC2035 | ||
tar -czf {{ .OutputDirectory }}/{{ .KubernetesVersion }}_redhat_8.10_x86_64{{ .FipsSuffix }}.tar.gz * | ||
#shellcheck disable=SC1083 | ||
chmod 777 {{ .OutputDirectory }}/{{ .KubernetesVersion }}_redhat_8.10_x86_64{{ .FipsSuffix }}.tar.gz | ||
popd | ||
rm -rf "${TMP_DIR}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
audit | ||
ca-certificates | ||
conntrack-tools | ||
chrony | ||
ebtables | ||
open-vm-tools | ||
python2-pip | ||
python3-pip | ||
socat | ||
yum-utils | ||
yum-plugin-versionlock | ||
NetworkManager | ||
cloud-init | ||
cloud-utils-growpart | ||
container-selinux | ||
{{ if .FetchKubernetesRPMs -}} | ||
kubectl-{{ .KubernetesVersion }}-0 | ||
kubelet-{{ .KubernetesVersion }}-0 | ||
kubeadm-{{ .KubernetesVersion }}-0 | ||
cri-tools | ||
{{- end }} | ||
conntrack | ||
ebtables | ||
ethtool | ||
iproute | ||
iptables | ||
iscsi-initiator-utils | ||
socat | ||
gcc | ||
glibc-devel | ||
make | ||
libseccomp | ||
iproute-tc | ||
gssproxy | ||
libverto-module-base | ||
libverto | ||
nfs-utils | ||
{{ if .FetchKernelHeaders -}} | ||
kernel-headers | ||
kernel-devel | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[kubernetes] | ||
name=Konvoy Kubernetes package repository | ||
baseurl=https://packages.d2iq.com/konvoy/stable/linux/repos/el/kubernetes-v{{ .KubernetesVersion }}-{{ .RepoSuffix }}/x86_64 | ||
gpgcheck=1 | ||
gpgkey=https://packages.d2iq.com/konvoy/stable/linux/repos/d2iq-sign-authority-gpg-public-key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
build_name: "rhel-8.10" | ||
packer_builder_type: "amazon" | ||
python_path: "" | ||
packer: | ||
ami_filter_name: "RHEL-8.10.0_HVM-*" | ||
ami_filter_owners: "309956199498" | ||
distribution: "RHEL" | ||
distribution_version: "8.10" | ||
source_ami: "" | ||
ssh_username: "ec2-user" | ||
root_device_name: "/dev/sda1" | ||
volume_size: "15" | ||
|