From 9e5fb458b41d0cf06c0108240a9e9c75912736ef Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 21 Jan 2022 14:38:42 -0500 Subject: [PATCH 1/3] update saltstack repo location for securityonioncache.repo / managerupdates=1 --- salt/repo/client/files/centos/securityonioncache.repo | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/salt/repo/client/files/centos/securityonioncache.repo b/salt/repo/client/files/centos/securityonioncache.repo index f4ec6ef3f..be8f41566 100644 --- a/salt/repo/client/files/centos/securityonioncache.repo +++ b/salt/repo/client/files/centos/securityonioncache.repo @@ -42,14 +42,7 @@ gpgkey=https://repo.securityonion.net/file/securityonion-repo/keys/docker.pub [saltstack] name=SaltStack repo for RHEL/CentOS $releasever PY3 -baseurl=http://repocache.securityonion.net/file/securityonion-repo/saltstack3003/ -enabled=1 -gpgcheck=1 -gpgkey=https://repo.securityonion.net/file/securityonion-repo/keys/SALTSTACK-GPG-KEY.pub - -[saltstack3003] -name=SaltStack repo for RHEL/CentOS $releasever PY3 -baseurl=http://repocache.securityonion.net/file/securityonion-repo/saltstack3003/ +baseurl=http://repocache.securityonion.net/file/securityonion-repo/saltstack/ enabled=1 gpgcheck=1 gpgkey=https://repo.securityonion.net/file/securityonion-repo/keys/SALTSTACK-GPG-KEY.pub From 58c5db3bf61311ea5f5b160b49a89c4291d28882 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 21 Jan 2022 15:15:48 -0500 Subject: [PATCH 2/3] reorder process in securityonion_repo function --- setup/so-functions | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index d07afc532..fab2a19ec 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -2343,16 +2343,16 @@ securityonion_repo() { fi # need to yum clean all before repo conf files are removed or clean,cleans nothing logCmd "yum -v clean all" - # update this package before we remove repo config files because the repo config files get added back - # when the package is updated when the update_packages function is called - logCmd "yum -v -y -c $repo_conf_file update centos-release" logCmd "mkdir -vp /root/oldrepos" logCmd "mv -v /etc/yum.repos.d/* /root/oldrepos/" logCmd "ls -la /etc/yum.repos.d/" - logCmd "rm -vrf /etc/yum.repos.d" - logCmd "yum repolist all" - logCmd "mkdir -vp /etc/yum.repos.d" logCmd "cp -f $repo_conf_file /etc/yum.repos.d/" + logCmd "yum -v repolist all" + # update this package because the repo config files get added back + # if the package is updated when the update_packages function is called + logCmd "yum -v -y update centos-release" + # move the repo files that we added by the centos-release package + logCmd "find /etc/yum.repos.d/ -type f -not -name 'securityonion*repo' -print0 | xargs -0 -I {} mv -bvf {} /root/oldrepos/" logCmd "yum repolist all" fi else From 32080b02e444b2097f4bb67d6b08664da5ff7209 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Fri, 21 Jan 2022 17:28:40 -0500 Subject: [PATCH 3/3] dont use logCmd for moving repo files after centos-release update --- setup/so-functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index fab2a19ec..cd397d177 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -2347,12 +2347,12 @@ securityonion_repo() { logCmd "mv -v /etc/yum.repos.d/* /root/oldrepos/" logCmd "ls -la /etc/yum.repos.d/" logCmd "cp -f $repo_conf_file /etc/yum.repos.d/" - logCmd "yum -v repolist all" + logCmd "yum repolist all" # update this package because the repo config files get added back # if the package is updated when the update_packages function is called logCmd "yum -v -y update centos-release" - # move the repo files that we added by the centos-release package - logCmd "find /etc/yum.repos.d/ -type f -not -name 'securityonion*repo' -print0 | xargs -0 -I {} mv -bvf {} /root/oldrepos/" + echo "Move the .repo files that were added by the centos-release package." + find /etc/yum.repos.d/ -type f -not -name 'securityonion*repo' -print0 | xargs -0 -I {} mv -bvf {} /root/oldrepos/ logCmd "yum repolist all" fi else