I am trying to use SaltStack to configure macOS, for this i am using hombrew obviously to install various formula and cask.
$ sudo salt-call --local --file-root=/tmp/gitrepo state.apply top.sls
and then in one of virtualbox.sls file use cmd.run to install application using cask
virtualbox: cmd.run: - name: brew cask install virtualbox
While its works out perfectly for formula, its throwing
Running Homebrew as root user error for cask
- This is primarily because in default conditions, salt-call has to run with sudo and in turn brew cask install then gives error as effectively it run as root user
Anybody has encountered similar issue? If yes, what steps or other method you have used to install cask using saltstack?