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 () {
|
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
|
||||||
|
|
Loading…
Reference in a new issue