Adding user group to the grain configuration
This commit is contained in:
parent
755b076fb8
commit
5807d83862
1 changed files with 6 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue