Disable fastestmirror during setup + soup

This commit is contained in:
William Wernert
2021-04-20 15:18:06 -04:00
parent 3d90423495
commit 3f007f1026
4 changed files with 19 additions and 12 deletions

View File

@@ -122,6 +122,10 @@ check_elastic_license() {
fi
}
disable_fastestmirror() {
sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
}
elastic_license() {
read -r -d '' message <<- EOM

View File

@@ -425,8 +425,9 @@ up_2.3.3X_to_2.3.50_repo() {
if [[ "$OS" == "centos" ]]; then
# Import GPG Keys
gpg_rpm_import
if [ $is_airgap -eq 1 ]; then
echo "Disabling fastestmirror."
disable_fastestmirror
echo "Deleting unneeded repo files."
DELREPOS=('CentOS-Base' 'CentOS-CR' 'CentOS-Debuginfo' 'docker-ce' 'CentOS-fasttrack' 'CentOS-Media' 'CentOS-Sources' 'CentOS-Vault' 'CentOS-x86_64-kernel' 'epel' 'epel-testing' 'saltstack' 'wazuh')

View File

@@ -2321,24 +2321,24 @@ secrets_pillar(){
securityonion_repo() {
# Remove all the current repos
if [[ "$OS" == "centos" ]]; then
if [[ "$INTERWEBS" == "AIRGAP" ]]; then
echo "This is airgap I don't need to add this repo"
if [[ "$INTERWEBS" == "AIRGAP" ]]; then
echo "This is airgap I don't need to add this repo"
else
mkdir -p /root/oldrepos
mv -v /etc/yum.repos.d/* /root/oldrepos/
mkdir -p /root/oldrepos
mv -v /etc/yum.repos.d/* /root/oldrepos/
ls -la /etc/yum.repos.d/
rm -rf /etc/yum.repos.d
rm -rf /etc/yum.repos.d
yum clean all
yum repolist all
mkdir -p /etc/yum.repos.d
if [[ ! $is_manager && "$MANAGERUPDATES" == "1" ]]; then
cp -f ../salt/repo/client/files/centos/securityonioncache.repo /etc/yum.repos.d/
else
cp -f ../salt/repo/client/files/centos/securityonion.repo /etc/yum.repos.d/
fi
if [[ ! $is_manager && "$MANAGERUPDATES" == "1" ]]; then
cp -f ../salt/repo/client/files/centos/securityonioncache.repo /etc/yum.repos.d/
else
cp -f ../salt/repo/client/files/centos/securityonion.repo /etc/yum.repos.d/
fi
fi
else
echo "This is Ubuntu"
echo "This is Ubuntu"
fi
}

View File

@@ -634,6 +634,8 @@ echo "1" > /root/accept_changes
set_progress_str 2 'Updating packages'
# Import the gpg keys
gpg_rpm_import >> $setup_log 2>&1
info "Disabling fastestmirror"
[[ $OS == 'centos' ]] && disable_fastestmirror
if [[ ! $is_airgap ]]; then
securityonion_repo >> $setup_log 2>&1
update_packages >> $setup_log 2>&1