Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS support does not work #352

Open
colin-stubbs opened this issue Jan 6, 2018 · 5 comments
Open

macOS support does not work #352

colin-stubbs opened this issue Jan 6, 2018 · 5 comments

Comments

@colin-stubbs
Copy link
Contributor

Minion cannot be managed on grain.os == 'MacOS' systems.

Current use of 'pkg.installed' statement fails if Brew is not available and/or Salt configured to interact with it properly. Brew based salt-minion is an inappropriate way of installing/managing salt now that official .pkg releases are available.

The following are the principle issues for swapping to .pkg based install/upgrade of minion:

  1. Installed .pkg name is actually 'com.saltstack.salt'
  2. True config path is '/private/etc/salt'
  3. Service name is 'com.saltstack.salt.minion'
  4. No current entry in os_family_map for 'MacOS' for salt-formula
  5. .pkg needs to be downloaded
  6. .pkg installation should occur using macpackage.installed (or cmd.run 'installer -pkg /path/to/salt.pkg -target /')

Reference info:
https://docs.saltstack.com/en/latest/topics/installation/osx.html
https://repo.saltstack.com/osx/
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.mac_package.html

@aboe76
Copy link
Member

aboe76 commented Jan 6, 2018

@colin-stubbs could you make a pr to revert the changes?

colin-stubbs added a commit to colin-stubbs/salt-formula that referenced this issue Apr 2, 2018
colin-stubbs added a commit to colin-stubbs/salt-formula that referenced this issue Apr 2, 2018
@colin-stubbs
Copy link
Contributor Author

I've re-attempted this with a new pull request that also handles the situation better on MacOS. Sorry about the stuff around back in Jan. It's a pull from an isolated branch of my fork now too.

aboe76 pushed a commit that referenced this issue Apr 17, 2018
* Add MacOS support; fix Issue #352

* On MacOS, only attempt download if condition

Add if salt_settings.install_packages to requisites for an attempt to download the minion package on MacOS

* Update example pillar for MacOS support

Describe how to use MacOS specific options

* Add MacOS notes

* Update README.rst

* Update README.rst
ixs pushed a commit to bawuenet/salt-formula that referenced this issue Jul 22, 2018
…as#363)

* Add MacOS support; fix Issue saltstack-formulas#352

* On MacOS, only attempt download if condition

Add if salt_settings.install_packages to requisites for an attempt to download the minion package on MacOS

* Update example pillar for MacOS support

Describe how to use MacOS specific options

* Add MacOS notes

* Update README.rst

* Update README.rst
@aboe76 aboe76 closed this as completed Jan 26, 2019
@noelmcloughlin
Copy link
Member

noelmcloughlin commented Jul 17, 2019

MacOS support still does not work with too many state errors.

local:
    ----------
    base:
        # salt.pkgrepo
        - salt.minion
        - salt.master
        - salt.formulas
        - salt.ssh
------------
Succeeded: 4 (changed=2)
Failed:    8
------------




    Function: pkg.installed
        Name: com.saltstack.salt
      Result: False
     Comment: Brew command failed. Additional info follows:

              result:
                  ----------
                  pid:
                      15745
                  retcode:
                      1
                  stderr:
                      Error: No available formula with the name "com.saltstack.salt"
                      Warning: homebrew/core is shallow clone. To get complete history run:
                        git -C "$(brew --repo homebrew/core)" fetch --unshallow

                      Error: No previously deleted formula found.
                      Error: No similarly named formulae found.
                      ==> Searching taps on GitHub...
                      Error: No formulae found in taps.
                  stdout:
                      ==> Searching for a previously deleted formula (in the last month)...
                      ==> Searching for similarly named formulae...
                      ==> Searching taps...
     Started: 22:53:42.010211
    Duration: 5794.797 ms
     Changes:


ID: salt-minion
    Function: service.running
        Name: com.saltstack.salt.minion
      Result: False
     Comment: One or more requisite failed: salt.minion.salt-minion
     Started: 22:53:48.098084
    Duration: 0.006 ms
     Changes:
----------
          ID: salt-minion
    Function: cmd.run
        Name: exec 0>&- # close stdin
exec 1>&- # close stdout
exec 2>&- # close stderr
nohup salt-call --local service.restart com.saltstack.salt.minion --out-file /dev/null &
      Result: False
     Comment: The following requisites were not found:
                                 onchanges:
                                     macpackage: salt-minion
     Started: 22:53:48.099380
    Duration: 0.005 ms
     Changes:


          ID: remove-macpackage-salt
    Function: cmd.run
        Name: rm -f /tmp/salt.pkg
      Result: False
     Comment: The following requisites were not found:
                                 onchanges:
                                     macpackage: salt-minion
     Started: 22:53:48.101214
    Duration: 0.003 ms
     Changes:


 ID: salt-master
    Function: pkg.installed
      Result: False
     Comment: Brew command failed. Additional info follows:

              result:
                  ----------
                  pid:
                      16390
                  retcode:
                      1
                  stderr:
                      Error: No available formula with the name "salt-master"
                      Warning: homebrew/core is shallow clone. To get complete history run:
                        git -C "$(brew --repo homebrew/core)" fetch --unshallow

                      Error: No previously deleted formula found.
                      Error: No similarly named formulae found.
                      ==> Searching taps on GitHub...
                      Error: No formulae found in taps.
                  stdout:
                      ==> Searching for a previously deleted formula (in the last month)...
                      ==> Searching for similarly named formulae...
                      ==> Searching taps...
     Started: 22:53:48.715445
    Duration: 7068.841 ms
     Changes:


 ID: salt-master
    Function: service.running
      Result: False
     Comment: One or more requisite failed: salt.master.salt-master
     Started: 22:53:56.145457
    Duration: 0.003 ms
     Changes:
----------
          ID: ensure-salt-ssh-is-installed
    Function: pkg.installed
        Name: salt-ssh
      Result: False
     Comment: Brew command failed. Additional info follows:

              result:
                  ----------
                  pid:
                      17044
                  retcode:
                      1
                  stderr:
                      Error: No available formula with the name "salt-ssh"
                      Warning: homebrew/core is shallow clone. To get complete history run:
                        git -C "$(brew --repo homebrew/core)" fetch --unshallow

                      Error: No previously deleted formula found.
                      Error: No similarly named formulae found.
                      ==> Searching taps on GitHub...
                      Error: No formulae found in taps.
                  stdout:
                      ==> Searching for a previously deleted formula (in the last month)...
                      ==> Searching for similarly named formulae...
                      ==> Searching taps...
     Started: 22:53:56.584462
    Duration: 7667.618 ms
     Changes:

          ID: ensure-roster-config
    Function: file.managed
        Name: /private/etc/salt/roster
      Result: False
     Comment: One or more requisite failed: salt.ssh.ensure-salt-ssh-is-installed
     Started: 22:54:04.252866
    Duration: 0.004 ms
     Changes:

@noelmcloughlin
Copy link
Member

Mac Package cannot be handled either. Note minion.sls needs to be hacked to even test this.

pillars

  install_packages: True
  salt_minion_pkg_source: 'https://repo.saltstack.com/osx/salt-2019.2.0-py2-x86_64.pkg'
  salt_minion_pkg_hash: 'https://repo.saltstack.com/osx/salt-2019.2.0-py2-x86_64.pkg.md5'

result:

          ID: download-salt-minion
    Function: file.managed
        Name: /tmp/salt.pkg
      Result: False
     Comment: Unable to manage file: 'utf-8' codec can't decode byte 0xff in 
              position 0: invalid start byte

@noelmcloughlin
Copy link
Member

noelmcloughlin commented Aug 22, 2019

Tested salt-minion state on new macOS yesterday.

  1. "The following requisite was not found: macpackage: salt-minion.

Since salt-bootstrap and salter install salt via homebrew on masterless-minion, that method could be default for all minions and macpackage could be alternative choice? Maybe #macos in slack can advise.

  1. "Group root not found"

Standard fix can be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants