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 () {
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
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
echo "Sit down and chillax..."
sudo salt-call --local --config=./ --state-output=changes --log-level=quiet state.apply
fi
}
state="$1"
_main