From cc6b6de7a076d919b927962605205dc6e7611bad Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Tue, 15 Feb 2022 16:01:53 -0500 Subject: [PATCH] Add Rocky Linux to nodepool elements tooling Change-Id: I2a94a34b1518c90ef5f0d91c9131482520c38c62 --- .../elements/infra-package-needs/install.d/10-packages | 4 ++-- nodepool/elements/infra-package-needs/pkg-map | 7 +++++++ .../post-install.d/80-enable-infra-services | 2 +- .../elements/nodepool-base/finalise.d/89-boot-settings | 6 +++--- nodepool/elements/nodepool-base/install.d/20-iptables | 2 +- nodepool/elements/nodepool-base/post-install.d/20-iptables | 4 ++-- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/nodepool/elements/infra-package-needs/install.d/10-packages b/nodepool/elements/infra-package-needs/install.d/10-packages index 5d62a9e67f..238b6b7977 100755 --- a/nodepool/elements/infra-package-needs/install.d/10-packages +++ b/nodepool/elements/infra-package-needs/install.d/10-packages @@ -20,8 +20,8 @@ if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then fi set -e -if [[ "$DISTRO_NAME" == centos && ${DIB_RELEASE} != '9-stream' ]] ; then +if [[ "$DISTRO_NAME" =~ ^(centos|rocky)$ && ${DIB_RELEASE} != '9-stream' ]] ; then # 9-stream we are just using the default rngd - # Note: $YUM exposed by centos environment, correct across releases + # Note: $YUM exposed by centos|rhel-like environment, correct across releases ${YUM} -y install --enablerepo=epel haveged fi diff --git a/nodepool/elements/infra-package-needs/pkg-map b/nodepool/elements/infra-package-needs/pkg-map index 0e97fb8be2..64f8e85a0a 100644 --- a/nodepool/elements/infra-package-needs/pkg-map +++ b/nodepool/elements/infra-package-needs/pkg-map @@ -13,6 +13,13 @@ "iptables": "iptables-services" } }, + "rocky": { + "8": { + "python-dev": "", + "ntp": "chrony", + "ntpdate": "" + } + }, "ubuntu": { "focal": { "ntp": "", diff --git a/nodepool/elements/infra-package-needs/post-install.d/80-enable-infra-services b/nodepool/elements/infra-package-needs/post-install.d/80-enable-infra-services index 96547479b7..72f65aac05 100755 --- a/nodepool/elements/infra-package-needs/post-install.d/80-enable-infra-services +++ b/nodepool/elements/infra-package-needs/post-install.d/80-enable-infra-services @@ -17,7 +17,7 @@ case "$DIB_INIT_SYSTEM" in if [[ ${DIB_RELEASE} != 'focal' ]]; then systemctl enable ntp.service fi - elif [[ ( $DISTRO_NAME == "centos" && $DIB_RELEASE > 7 ) || $DISTRO_NAME == "fedora" ]]; then + elif [[ ( $DISTRO_NAME == "centos" && $DIB_RELEASE > 7 ) || $DISTRO_NAME == "fedora" || $DISTRO_NAME == "rocky" ]]; then systemctl enable chronyd else systemctl enable ntpd.service diff --git a/nodepool/elements/nodepool-base/finalise.d/89-boot-settings b/nodepool/elements/nodepool-base/finalise.d/89-boot-settings index ee0e400a38..9fbb4968a3 100755 --- a/nodepool/elements/nodepool-base/finalise.d/89-boot-settings +++ b/nodepool/elements/nodepool-base/finalise.d/89-boot-settings @@ -68,7 +68,7 @@ mv /tmp/forwarding.conf /etc/unbound/ chown root:root /etc/unbound/forwarding.conf chmod a+r /etc/unbound/forwarding.conf -if [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler) ]] ; then +if [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler|rocky) ]] ; then LOG_FILE="/var/lib/unbound/unbound.log" else LOG_FILE="/var/log/unbound.log" @@ -82,7 +82,7 @@ server: verbosity: 5" echo "$UNBOUND_LOGGING_CONF" > /tmp/unbound-logging.conf -if [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|opensuse|openeuler) ]] ; then +if [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|opensuse|openeuler|rocky) ]] ; then UNBOUND_CONFD=/etc/unbound/conf.d elif [[ "$DISTRO_NAME" =~ 'gentoo' ]] ; then UNBOUND_CONFD=/etc/unbound/conf.d @@ -185,7 +185,7 @@ sed -i -e 's/dlv-anchor-file:/#dlv-anchor-file:/g' /etc/unbound/unbound.conf # Tripleo uses dhcp dhcp_file='' -if [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler) ]] ; then +if [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler|rocky) ]] ; then dhcp_file=/etc/dhcp/dhclient-eth0.conf elif [[ "$DISTRO_NAME" =~ (debian|ubuntu|gentoo) ]] ; then dhcp_file=/etc/dhcp/dhclient.conf diff --git a/nodepool/elements/nodepool-base/install.d/20-iptables b/nodepool/elements/nodepool-base/install.d/20-iptables index d2acc7bdc9..ff60961a88 100755 --- a/nodepool/elements/nodepool-base/install.d/20-iptables +++ b/nodepool/elements/nodepool-base/install.d/20-iptables @@ -24,7 +24,7 @@ if [[ "$DISTRO_NAME" =~ (debian|ubuntu) ]] ; then rules_dir=/etc/iptables ipv4_rules=${rules_dir}/rules.v4 ipv6_rules=${rules_dir}/rules.v6 -elif [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler) ]] ; then +elif [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler|rocky) ]] ; then rules_dir=/etc/sysconfig ipv4_rules=${rules_dir}/iptables ipv6_rules=${rules_dir}/ip6tables diff --git a/nodepool/elements/nodepool-base/post-install.d/20-iptables b/nodepool/elements/nodepool-base/post-install.d/20-iptables index 5093402242..7fd0de30af 100755 --- a/nodepool/elements/nodepool-base/post-install.d/20-iptables +++ b/nodepool/elements/nodepool-base/post-install.d/20-iptables @@ -22,7 +22,7 @@ set -e if [[ "$DISTRO_NAME" =~ (debian|ubuntu) ]] ; then service_name=netfilter-persistent -elif [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler) ]] ; then +elif [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler|rocky) ]] ; then service_name=iptables elif [[ "$DISTRO_NAME" == 'opensuse' ]] ; then # handle iptables through init.d instead of a service @@ -48,7 +48,7 @@ case "$DIB_INIT_SYSTEM" in else systemctl enable ${service_name}.service fi - if [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler) ]] ; then + if [[ "$DISTRO_NAME" =~ (centos|rhel7|fedora|openeuler|rocky) ]] ; then systemctl enable ip6tables.service fi ;;