Setup Script - Added bro lbprocs function and other cleanup

This commit is contained in:
Mike Reeves
2018-03-23 01:11:46 -04:00
parent 1458694384
commit 99cfe3ff6e

View File

@@ -25,9 +25,15 @@ CPUCORES=$(cat /proc/cpuinfo | grep processor | wc -l)
# Functions # Functions
#bro_calculate_lbprocs() { bro_calculate_lbprocs() {
#Calculate total lbprocs for basic install #Calculate total lbprocs for basic install
#} local CORES4BRO=$(( $CPUCORES/2 ))
LBPROCS=$(printf "%.0f\n" $CORES4BRO)
}
bro_pins(){
echo "Bro Pins will go here"
}
accept_salt_key_local() { accept_salt_key_local() {
# Accept the key # Accept the key
@@ -41,11 +47,12 @@ accept_salt_key_remote() {
} }
add_socore_user_master() { add_socore_user_master() {
groupadd --gid 939 socore
$ADDUSER --uid 939 --gid 939 --home-dir /opt/so
} }
add_socore_user_notmaster() { add_socore_user_notmaster() {
# Add socore user to the system # Add socore user to the system. Probably not a bad idea to make system user
groupadd --gid 939 socore groupadd --gid 939 socore
$ADDUSER --uid 939 --gid 939 --home-dir /opt/so --no-create-home socore $ADDUSER --uid 939 --gid 939 --home-dir /opt/so --no-create-home socore
@@ -60,6 +67,10 @@ configure_minion() {
service salt-minion start service salt-minion start
} }
copy_master_config() {
cp files/master /etc/salt/master
}
copy_minion_pillar() { copy_minion_pillar() {
local TYPE=$1 local TYPE=$1
@@ -80,6 +91,7 @@ configure_sensor_pillar() {
touch /tmp/$HOSTNAME.sls touch /tmp/$HOSTNAME.sls
echo "sensors:" > /tmp/$HOSTNAME.sls echo "sensors:" > /tmp/$HOSTNAME.sls
echo " interface: bond0" >> /tmp/$HOSTNAME.sls echo " interface: bond0" >> /tmp/$HOSTNAME.sls
# Need to add logic here to determine if you are pinning or not or standalone
echo " bro_lbprocs: $LBPROCS" >> /tmp/$HOSTNAME.sls echo " bro_lbprocs: $LBPROCS" >> /tmp/$HOSTNAME.sls
# Need to add pins loop # Need to add pins loop
@@ -153,6 +165,8 @@ got_root() {
install_master() { install_master() {
yum -y install salt-master yum -y install salt-master
copy_master_config
# If Centos Enable the service
} }
ls_heapsize() { ls_heapsize() {
@@ -377,6 +391,8 @@ if (whiptail_you_sure) then
add_socore_user add_socore_user
update_sudoers update_sudoers
chmod_salt chmod_salt
es_heapsize
ls_heapsize
master_pillar master_pillar
start_salt start_salt
accept_salt_key_local accept_salt_key_local