From d2e623747d4c71e77bd01cc4601e3b2497005362 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 10 Jan 2023 11:34:50 -0500 Subject: [PATCH 1/4] ensure yum-utils and createrepo are installed from so remote repo --- setup/so-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/so-functions b/setup/so-functions index fb6cb7c48..83000cb54 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1926,7 +1926,7 @@ repo_sync_local() { if [[ ! "$REPOSYNC" -gt 0 ]]; then # Install reposync info "Installing createrepo" - logCmd "yum -y install yum-utils createrepo" + logCmd "yum install -y -c /root/repodownload.conf --disablerepo='*' --enablerepo='securityonionsync' yum-utils createrepo" else info "We have what we need to sync" fi From 39d808cb8f571f87c1353003bce50cfe613ac780 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 10 Jan 2023 11:50:58 -0500 Subject: [PATCH 2/4] resolve conflict --- setup/so-functions | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 0c5c931a9..478df1024 100644 --- a/setup/so-functions +++ b/setup/so-functions @@ -1935,15 +1935,6 @@ securityonion_repo() { repo_sync_local() { # Sync the repo from the the SO repo locally. # Check for reposync - REPOSYNC=$(rpm -qa | grep createrepo | wc -l) - if [[ ! "$REPOSYNC" -gt 0 ]]; then - # Install reposync - info "Installing createrepo" - logCmd "yum install -y -c /root/repodownload.conf --disablerepo='*' --enablerepo='securityonionsync' yum-utils createrepo" - else - info "We have what we need to sync" - fi - info "Backing up old repos" mkdir -p /nsm/repo mkdir -p /root/reposync_cache echo "[main]" > /root/repodownload.conf @@ -1970,14 +1961,14 @@ repo_sync_local() { if [[ ! "$REPOSYNC" -gt 0 ]]; then # Install reposync info "Installing createrepo" - logCmd "yum -y install -c /root/repodownload.conf yum-utils createrepo" + logCmd "yum install -y -c /root/repodownload.conf --disablerepo='*' --enablerepo='securityonionsync' yum-utils createrepo" else info "We have what we need to sync" fi logCmd "reposync --norepopath -n -g -l -d -m -c /root/repodownload.conf -r securityonionsync --download-metadata -p /nsm/repo/" - + # After the download is complete run createrepo create_repo From d3b8fbaafcaaefcd60bd71d2abcd7d5c1771377a Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Tue, 10 Jan 2023 13:13:13 -0500 Subject: [PATCH 3/4] Revert "ensure yum-utils and createrepo are installed from so remote repo" --- setup/so-functions | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 setup/so-functions diff --git a/setup/so-functions b/setup/so-functions old mode 100644 new mode 100755 index 478df1024..85b35c54c --- a/setup/so-functions +++ b/setup/so-functions @@ -1935,6 +1935,7 @@ securityonion_repo() { repo_sync_local() { # Sync the repo from the the SO repo locally. # Check for reposync + info "Backing up old repos" mkdir -p /nsm/repo mkdir -p /root/reposync_cache echo "[main]" > /root/repodownload.conf @@ -1961,14 +1962,14 @@ repo_sync_local() { if [[ ! "$REPOSYNC" -gt 0 ]]; then # Install reposync info "Installing createrepo" - logCmd "yum install -y -c /root/repodownload.conf --disablerepo='*' --enablerepo='securityonionsync' yum-utils createrepo" + logCmd "yum -y install -c /root/repodownload.conf yum-utils createrepo" else info "We have what we need to sync" fi logCmd "reposync --norepopath -n -g -l -d -m -c /root/repodownload.conf -r securityonionsync --download-metadata -p /nsm/repo/" - + # After the download is complete run createrepo create_repo From 0151830c85299ab3feeaba89c415f0104b1b2031 Mon Sep 17 00:00:00 2001 From: Josh Patterson Date: Tue, 10 Jan 2023 13:37:56 -0500 Subject: [PATCH 4/4] Update so-functions --- setup/so-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/so-functions b/setup/so-functions index fb6cb7c48..b4c4340e0 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -613,7 +613,7 @@ configure_minion() { "log_level_logfile: info"\ "log_file: /opt/so/log/salt/minion" >> "$minion_config" - cp -f ../salt/salt/etc/minion.d/mine_functions.conf /etc/salt/minion.d/mine_functions.conf + cp -f ../salt/salt/etc/minion.d/mine_functions.conf.jinja /etc/salt/minion.d/mine_functions.conf sed -i "s/{{ GLOBALS.main_interface }}/$MAININT/" /etc/salt/minion.d/mine_functions.conf {