install createrepo on airgap and non airgap

This commit is contained in:
m0duspwnens
2024-10-22 13:56:38 -04:00
parent 21f359456c
commit 8d2ae23ae6
2 changed files with 9 additions and 3 deletions

View File

@@ -45,6 +45,12 @@ yara_log_dir:
- user - user
- group - group
{% if GLOBALS.os_family == 'RedHat' %}
install_createrepo:
pkg.installed:
- name: createrepo
{% endif %}
repo_conf_dir: repo_conf_dir:
file.directory: file.directory:
- name: /opt/so/conf/reposync - name: /opt/so/conf/reposync

View File

@@ -803,7 +803,6 @@ create_manager_pillars() {
create_repo() { create_repo() {
title "Create the repo directory" title "Create the repo directory"
logCmd "dnf -y install yum-utils createrepo"
logCmd "createrepo /nsm/repo" logCmd "createrepo /nsm/repo"
} }
@@ -1821,13 +1820,14 @@ repo_sync_local() {
echo "gpgcheck=1" >> /opt/so/conf/reposync/repodownload.conf echo "gpgcheck=1" >> /opt/so/conf/reposync/repodownload.conf
logCmd "dnf repolist" logCmd "dnf repolist"
logCmd "dnf -y install yum-utils createrepo"
if [[ ! $is_airgap ]]; then if [[ ! $is_airgap ]]; then
curl --retry 5 --retry-delay 60 -A "netinstall/$SOVERSION/$OS/$(uname -r)/1" https://sigs.securityonion.net/checkup --output /tmp/install curl --retry 5 --retry-delay 60 -A "netinstall/$SOVERSION/$OS/$(uname -r)/1" https://sigs.securityonion.net/checkup --output /tmp/install
retry 5 60 "dnf reposync --norepopath -g --delete -m -c /opt/so/conf/reposync/repodownload.conf --repoid=securityonionsync --download-metadata -p /nsm/repo/" >> "$setup_log" 2>&1 || fail_setup retry 5 60 "dnf reposync --norepopath -g --delete -m -c /opt/so/conf/reposync/repodownload.conf --repoid=securityonionsync --download-metadata -p /nsm/repo/" >> "$setup_log" 2>&1 || fail_setup
fi
# After the download is complete run createrepo # After the download is complete run createrepo
create_repo create_repo
fi
else else
# Add the proper repos for unsupported stuff # Add the proper repos for unsupported stuff
echo "Adding Repos" echo "Adding Repos"