ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Saltstack and Brew Casks

    IT Discussion
    salt casks osx apple devops
    3
    6
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DustinB3403D
      DustinB3403
      last edited by

      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> and salt '*' 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. IE

      salt '*' pkg.install obs results in

       salt '*' 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?

      black3dynamiteB 1 Reply Last reply Reply Quote 0
      • black3dynamiteB
        black3dynamite @DustinB3403
        last edited by

        @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> and salt '*' 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. IE

        salt '*' pkg.install obs results in

        salt '*' 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 with brew install <package name> instead of brew cask install <package name>

        DustinB3403D 1 Reply Last reply Reply Quote 0
        • DustinB3403D
          DustinB3403 @black3dynamite
          last edited by

          @black3dynamite

          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.
          
          black3dynamiteB shortstackS 2 Replies Last reply Reply Quote 1
          • black3dynamiteB
            black3dynamite @DustinB3403
            last edited by

            @DustinB3403 said in Saltstack and Brew Casks:

            @black3dynamite

            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: 5

            Or

            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 use salt-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
            
            1 Reply Last reply Reply Quote 0
            • shortstackS
              shortstack @DustinB3403
              last edited by

              @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?

              DustinB3403D 1 Reply Last reply Reply Quote 0
              • DustinB3403D
                DustinB3403 @shortstack
                last edited by

                @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

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post