diff --git a/packer/scripts/generalize.sh b/packer/scripts/generalize.sh index 596ba05..9be2b3a 100644 --- a/packer/scripts/generalize.sh +++ b/packer/scripts/generalize.sh @@ -23,13 +23,6 @@ sudo sh -c 'if [ -f /etc/udev/rules.d/70-persistent-net.rules ]; then rm /etc/udev/rules.d/70-persistent-net.rules fi' -# check for only RHEL releases -if [[ $(awk -F= '/^ID=/{print $2}' /etc/os-release | grep rhel) ]]; then - echo '>> Clearing RHSM subscription...' - sudo subscription-manager unregister - sudo subscription-manager clean -fi - echo '>> Clearing temp dirs...' sudo rm -rf /tmp/* sudo rm -rf /var/tmp/* diff --git a/packer/scripts/install-k8s.sh b/packer/scripts/install-k8s.sh index 7ac9e7e..0bb05d4 100644 --- a/packer/scripts/install-k8s.sh +++ b/packer/scripts/install-k8s.sh @@ -39,5 +39,5 @@ sudo swapoff -a echo ".. install kubernetes version ${KUBEVERSION}" sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list -sudo apt-get update && sudo apt-get install -y kubelet=${KUBEVERSION}-00 kubeadm=${KUBEVERSION}-00 kubectl=${KUBEVERSION}-00 +sudo apt-get update && sudo apt-get install -y kubelet="${KUBEVERSION}"-00 kubeadm="${KUBEVERSION}"-00 kubectl="${KUBEVERSION}"-00 sudo apt-mark hold kubelet kubeadm kubectl