Adding user group to the grain configuration

This commit is contained in:
Elijah Lazkani 2017-03-01 23:35:44 -05:00
parent 755b076fb8
commit 5807d83862

View file

@ -90,14 +90,17 @@ function _unknown_os () {
function _saltstack () { function _saltstack () {
echo "Bootstrapping SaltStack" echo "Bootstrapping SaltStack"
sudo salt-call --local --config=./ --state-output=changes grains.setvals "{ \"user\": \"$(whoami)\", \"homedir\": \"$HOME\" }" sudo salt-call --local --config=./ --state-output=changes grains.setvals "{ \"user\": \"$(whoami)\", \"group\": \"$(id -g -n $(whoami))\", \"homedir\": \"$HOME\" }"
if [[ $1 ]]; if [[ $state ]];
then then
sudo salt-call --local --config=./ --state-output=changes --log-level=quiet state.sls $1 echo "Running $state... Sit down and chillax..."
sudo salt-call --local --config=./ --state-output=changes --log-level=quiet state.sls $state
else else
echo "Sit down and chillax..."
sudo salt-call --local --config=./ --state-output=changes --log-level=quiet state.apply sudo salt-call --local --config=./ --state-output=changes --log-level=quiet state.apply
fi fi
} }
state="$1"
_main _main