SO Setup - Fix for CentOS in saltify function

This commit is contained in:
Mike Reeves
2018-09-10 10:59:43 -04:00
parent 188ce9dd89
commit 9f89826590
3 changed files with 17 additions and 6 deletions

View File

@@ -3,6 +3,7 @@
# Email: justin@hasecuritysolution.com # Email: justin@hasecuritysolution.com
# Last Update: 12/9/2016 # Last Update: 12/9/2016
filter { filter {
if "bro" in [tags] and "test_data" not in [tags] and "import" not in [tags] { if "bro" in [tags] and "test_data" not in [tags] and "import" not in [tags] {
mutate { mutate {

View File

@@ -1,8 +1,6 @@
{% set master = salt['grains.get']('master') %} {% set master = salt['grains.get']('master') %}
# Trust the CA # Trust the CA
#/usr/local/share/ca-certificates:
# file.directory: []
trusttheca: trusttheca:
x509.pem_managed: x509.pem_managed:

View File

@@ -392,6 +392,16 @@ saltify() {
yum clean expire-cache yum clean expire-cache
yum -y install salt-minion yum-utils device-mapper-persistent-data lvm2 openssl yum -y install salt-minion yum-utils device-mapper-persistent-data lvm2 openssl
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y update
# Nasty hack but required for now
if [ $INSTALLTYPE == 'MASTERONLY' ] || [ $INSTALLTYPE == 'EVALMODE' ]; then
yum -y install salt-master python-m2crypto salt-minion
else
yum -y install salt-minion python-m2m2crypto
fi
else else
ADDUSER=useradd ADDUSER=useradd
apt-get -y upgrade apt-get -y upgrade
@@ -417,6 +427,9 @@ saltify() {
mkdir -p /opt/so/gpg mkdir -p /opt/so/gpg
wget --inet4-only -O /opt/so/gpg/SALTSTACK-GPG-KEY.pub https://repo.saltstack.com/apt/ubuntu/$UVER/amd64/latest/SALTSTACK-GPG-KEY.pub wget --inet4-only -O /opt/so/gpg/SALTSTACK-GPG-KEY.pub https://repo.saltstack.com/apt/ubuntu/$UVER/amd64/latest/SALTSTACK-GPG-KEY.pub
wget --inet4-only -O /opt/so/gpg/docker.pub https://download.docker.com/linux/ubuntu/gpg wget --inet4-only -O /opt/so/gpg/docker.pub https://download.docker.com/linux/ubuntu/gpg
# Initialize the new repos
apt-get update >>~/sosetup.log 2>&1
apt-get -y install salt-minion python-m2crypto >>~/sosetup.log 2>&1
else else
@@ -425,15 +438,14 @@ saltify() {
scp socore@$MSRV:/opt/so/gpg/* $TMP/gpg scp socore@$MSRV:/opt/so/gpg/* $TMP/gpg
apt-key add $TMP/gpg/SALTSTACK-GPG-KEY.pub apt-key add $TMP/gpg/SALTSTACK-GPG-KEY.pub
echo "deb http://repo.saltstack.com/apt/ubuntu/$UVER/amd64/latest xenial main" > /etc/apt/sources.list.d/saltstack.list echo "deb http://repo.saltstack.com/apt/ubuntu/$UVER/amd64/latest xenial main" > /etc/apt/sources.list.d/saltstack.list
fi
# Initialize the new repos # Initialize the new repos
apt-get update >>~/sosetup.log 2>&1 apt-get update >>~/sosetup.log 2>&1
apt-get -y install salt-minion python-m2crypto >>~/sosetup.log 2>&1 apt-get -y install salt-minion python-m2crypto >>~/sosetup.log 2>&1
fi fi
fi
} }
docker_install() { docker_install() {