Saltstack and Brew Casks
-
Okay, so after finally getting my salt master to function, and my minion connected, I now want to test installing and uninstalling brew casks onto and from my minion.
The process is pretty straight-forward looking
salt '*' pkg.install <package name>
andsalt '*' pkg.remove <package name>
This seems to only work for things that are command line, for example
salt '*' pkg.install abook
works and I get a command line address book, but I can't install graphical software. IEsalt '*' pkg.install obs
results insalt '*' pkg.install obs [WARNING ] /usr/lib/python2.7/site-packages/salt/payload.py:149: DeprecationWarning: encoding is deprecated, Use raw=False instead. ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder, encoding=encoding) admins-MacBook-Air.local: ERROR: Brew command failed. Additional info follows: result: ---------- pid: 9212 retcode: 1 stderr: Error: No available formula with the name "obs" Found a cask named "obs" instead. stdout: ERROR: Minions returned with non-zero exit code
So to ask, what am I missing here?
-
@DustinB3403 said in Saltstack and Brew Casks:
Okay, so after finally getting my salt master to function, and my minion connected, I now want to test installing and uninstalling brew casks onto and from my minion.
The process is pretty straight-forward looking
salt '*' pkg.install <package name>
andsalt '*' pkg.remove <package name>
This seems to only work for things that are command line, for example
salt '*' pkg.install abook
works and I get a command line address book, but I can't install graphical software. IEsalt '*' pkg.install obs
results insalt '*' pkg.install obs
[WARNING ] /usr/lib/python2.7/site-packages/salt/payload.py:149: DeprecationWarning: encoding is deprecated, Use raw=False instead.
ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder, encoding=encoding)admins-MacBook-Air.local:
ERROR: Brew command failed. Additional info follows:result: ---------- pid: 9212 retcode: 1 stderr: Error: No available formula with the name "obs" Found a cask named "obs" instead. stdout:
ERROR: Minions returned with non-zero exit code
So to ask, what am I missing here?
Use this instead.
salt '*' cmd.run 'brew cask install obs -y'
salt '*' pkg.install <package name>
seems to only work withbrew install <package name>
instead ofbrew cask install <package name>
-
That doesn't seem to work for me.
Either as my non-admin user or root
salt '*' cmd.run 'brew cask install obs -y' [WARNING ] Failed to open log file, do you have permission to write to /var/log/salt/master? Salt request timed out. The master is not responding. You may need to run your command with `--async` in order to bypass the congested event bus. With `--async`, the CLI tool will print the job id (jid) and exit immediately without listening for responses. You can then use `salt-run jobs.lookup_jid` to look up the results of the job in the job cache later.
Root
salt '*' cmd.run 'brew cask install obs -y' [WARNING ] /usr/lib/python2.7/site-packages/salt/payload.py:149: DeprecationWarning: encoding is deprecated, Use raw=False instead. ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder, encoding=encoding) admins-MacBook-Air.local: Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
-
@DustinB3403 said in Saltstack and Brew Casks:
That doesn't seem to work for me.
Either as my non-admin user or root
salt '*' cmd.run 'brew cask install obs -y' [WARNING ] Failed to open log file, do you have permission to write to /var/log/salt/master? Salt request timed out. The master is not responding. You may need to run your command with `--async` in order to bypass the congested event bus. With `--async`, the CLI tool will print the job id (jid) and exit immediately without listening for responses. You can then use `salt-run jobs.lookup_jid` to look up the results of the job in the job cache later.
Root
salt '*' cmd.run 'brew cask install obs -y' [WARNING ] /usr/lib/python2.7/site-packages/salt/payload.py:149: DeprecationWarning: encoding is deprecated, Use raw=False instead. ret = msgpack.loads(msg, use_list=True, ext_hook=ext_type_decoder, encoding=encoding) admins-MacBook-Air.local: Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
https://docs.saltstack.com/en/latest/ref/cli/salt.html#options
Use the--timeout
option
The timeout in seconds to wait for replies from the Salt minions. The timeout number specifies how long the command line client will wait to query the minions and check on running jobs. Default: 5Or
Use
--async
option
Instead of waiting for the job to run on minions only print the job id of the started execution and complete. And then usesalt-run jobs.lookup_jid
to see the results.# Using --timeout sudo salt '*' cmd.run 'sudo -u non-adminuser brew cask install obs -y' --timeout 60 # Using --async sudo salt '*' cmd.run 'sudo -u non-adminuser brew cask install obs -y' --async
-
@DustinB3403 i am also wondering what the workaround for this issue is, re: salt minion executing brew installs. did you ever figure out a clean way to get brew working, maybe runas a different user?
-
@shortstack said in Saltstack and Brew Casks:
@DustinB3403 i am also wondering what the workaround for this issue is, re: salt minion executing brew installs. did you ever figure out a clean way to get brew working, maybe runas a different user?
I haven't had the chance to get back into this, other more pressing issues so I just went on with my day.
Sorry