mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #7713 from Security-Onion-Solutions/m0duspwnens-salt-3004.1
update update_repo function
This commit is contained in:
@@ -935,8 +935,19 @@ update_repo() {
|
||||
yum repolist
|
||||
fi
|
||||
elif [[ "$OS" == "ubuntu" ]]; then
|
||||
cp $UPDATE_DIR/salt/repo/client/files/ubuntu/$ubuntu_version/* /etc/apt/sources.list.d/
|
||||
apt-get update
|
||||
ubuntu_version=$(grep VERSION_ID /etc/os-release | awk -F '[ "]' '{print $2}')
|
||||
|
||||
if grep -q "UBUNTU_CODENAME=bionic" /etc/os-release; then
|
||||
OSVER=bionic
|
||||
elif grep -q "UBUNTU_CODENAME=focal" /etc/os-release; then
|
||||
OSVER=focal
|
||||
else
|
||||
echo "We do not support your current version of Ubuntu."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "deb http://repo.saltstack.com/py3/ubuntu/$ubuntu_version/amd64/archive/3004.1 $OSVER main" > /etc/apt/sources.list.d/saltstack.list
|
||||
apt-get update
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
deb https://repo.securityonion.net/file/securityonion-repo/ubuntu/18.04/amd64/salt/ bionic main
|
||||
@@ -1 +0,0 @@
|
||||
deb https://repo.securityonion.net/file/securityonion-repo/ubuntu/20.04/amd64/salt/ focal main
|
||||
@@ -1,4 +1,5 @@
|
||||
ubuntu_repo_files:
|
||||
- file.recurse:
|
||||
- name: /etc/apt/sources.list.d/
|
||||
- source: salt://repo/client/files/ubuntu/{{grains.osrelease}}/
|
||||
saltstack.list:
|
||||
- file.managed:
|
||||
- name: /etc/apt/sources.list.d/saltstack.list
|
||||
- contents:
|
||||
- deb https://repo.securityonion.net/file/securityonion-repo/ubuntu/{{grains.osrelease}}/amd64/salt/ {{grains.oscodename}} main
|
||||
|
||||
Reference in New Issue
Block a user