From 5807d8386220fa2a851053d92412e97e5d0ad76a Mon Sep 17 00:00:00 2001 From: Elijah Lazkani Date: Wed, 1 Mar 2017 23:35:44 -0500 Subject: [PATCH] Adding user group to the grain configuration --- bootstrap.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index b9ea010..1b4b319 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -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