From 52885e28c5012116fad1d096caad45fa0c70856e Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Thu, 9 Jul 2026 17:02:47 -0400 Subject: [PATCH] Name the reposync-side kernel repo securityonionkernelsync The reposync section in repodownload.conf and the client repo assigned in repo/client/oracle.sls both used the bare name securityonionkernel, colliding across the two roles. Rename the reposync-side section (and its --repoid, the so-repo-sync guard, and the so-kernel-upgrade presence check) to securityonionkernelsync, mirroring the existing securityonion/securityonionsync split for the main repo. The client repo stays securityonionkernel. Also give the section its own name=Security Onion Kernel Repo repo. --- salt/common/tools/sbin/so-kernel-upgrade | 10 +++++++--- salt/manager/files/repodownload.conf | 4 ++-- salt/manager/tools/sbin/so-repo-sync | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/salt/common/tools/sbin/so-kernel-upgrade b/salt/common/tools/sbin/so-kernel-upgrade index 960505aee..e750c1a52 100755 --- a/salt/common/tools/sbin/so-kernel-upgrade +++ b/salt/common/tools/sbin/so-kernel-upgrade @@ -39,7 +39,11 @@ . /usr/sbin/so-common +# Client-side repo id (what dnf enables on this node, from repo/client/oracle.sls) vs the +# reposync-side section in repodownload.conf that the manager mirrors from (mirrors the +# securityonion/securityonionsync split for the main repo). KERNEL_REPO="securityonionkernel" +KERNEL_REPO_SYNC="securityonionkernelsync" KERNEL_PKG="kernel-uek" KERNEL_REPO_DIR="/nsm/kernelrepo" REPOSYNC_CONF="/opt/so/conf/reposync/repodownload.conf" @@ -95,15 +99,15 @@ kernelrepo_rpm_count() { # The kernel repo starts life as valid-but-empty (kernelrepo_init_empty in # salt/manager/init.sls) and is filled by so-repo-sync. During a soup, so-repo-sync runs -# BEFORE the highstate deploys the [securityonionkernel] section into repodownload.conf, so +# BEFORE the highstate deploys the [securityonionkernelsync] section into repodownload.conf, so # the first kernel-aware soup leaves the repo empty until the next nightly sync. sync_kernel_repo() { if is_airgap; then log "airgap install: $KERNEL_REPO_DIR is populated from the airgap ISO, not by so-repo-sync." return 1 fi - if ! grep -q "^\[${KERNEL_REPO}\]" "$REPOSYNC_CONF" 2>/dev/null; then - log "$REPOSYNC_CONF has no [${KERNEL_REPO}] section -- run a highstate to deploy it." + if ! grep -q "^\[${KERNEL_REPO_SYNC}\]" "$REPOSYNC_CONF" 2>/dev/null; then + log "$REPOSYNC_CONF has no [${KERNEL_REPO_SYNC}] section -- run a highstate to deploy it." return 1 fi diff --git a/salt/manager/files/repodownload.conf b/salt/manager/files/repodownload.conf index 67ae4b121..9c9cb5109 100644 --- a/salt/manager/files/repodownload.conf +++ b/salt/manager/files/repodownload.conf @@ -11,8 +11,8 @@ name=Security Onion Repo repo mirrorlist=file:///opt/so/conf/reposync/mirror.txt enabled=1 gpgcheck=1 -[securityonionkernel] -name=Security Onion Repo repo +[securityonionkernelsync] +name=Security Onion Kernel Repo repo mirrorlist=file:///opt/so/conf/reposync/mirror-kernel.txt enabled=1 gpgcheck=1 diff --git a/salt/manager/tools/sbin/so-repo-sync b/salt/manager/tools/sbin/so-repo-sync index 6c1b9d509..d6a290c25 100755 --- a/salt/manager/tools/sbin/so-repo-sync +++ b/salt/manager/tools/sbin/so-repo-sync @@ -17,9 +17,9 @@ createrepo /nsm/repo # The kernel repo section is deployed to repodownload.conf by the manager highstate, which # runs AFTER this script during soup. On the first upgrade to a kernel-aware version the # on-disk config still predates the section, so guard on its presence to avoid dnf's -# "Unknown repo: 'securityonionkernel'" aborting the sync (set -e). The next sync after the +# "Unknown repo: 'securityonionkernelsync'" aborting the sync (set -e). The next sync after the # highstate deploys the section will pick it up. -if grep -q '^\[securityonionkernel\]' /opt/so/conf/reposync/repodownload.conf; then - dnf reposync --norepopath -g --delete -m -c /opt/so/conf/reposync/repodownload.conf --repoid=securityonionkernel --download-metadata -p /nsm/kernelrepo/ +if grep -q '^\[securityonionkernelsync\]' /opt/so/conf/reposync/repodownload.conf; then + dnf reposync --norepopath -g --delete -m -c /opt/so/conf/reposync/repodownload.conf --repoid=securityonionkernelsync --download-metadata -p /nsm/kernelrepo/ createrepo /nsm/kernelrepo fi