saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.11k stars 5.47k forks source link

pkgin disallowed on MacOS but is supported by pkgsrc #38896

Closed mattwillsher closed 6 years ago

mattwillsher commented 7 years ago

Description of Issue/Question

pkgin is use by pkgsrc to installed packages on a variety of operations systems. In the pkgin module a check is hardcoded that stops the module loading if it doesn't match one of the listed items

https://github.com/saltstack/salt/blob/2016.11/salt/modules/pkgin.py#L89

MacOS can run pkgin (https://pkgsrc.joyent.com) and is very close to the SmartOS version.

Setup

/etc/salt/minion:

providers:
  pkg: pkgin

state file:

utility_packages:
  pkg.installed:
    - pkgs: {{ salt['pillar.get']('utility_packages') }}

where utility_packages is a simple list of pkgsrc packages.

running salt-call still tries to use the homebrew module to install packages.

Steps to Reproduce Issue

Log outout to:

salt-call state.apply

[ERROR   ] Command 'brew install git fish gpg ncdu py27-boto keybase htop-osx zsh apg' failed with return code: 1
[ERROR   ] stdout: ==> Searching for similarly named formulae...
...
 [TRACE   ] Error loading module.pkgin: The pkgin execution module cannot be loaded: only available on NetBSD, SunOS, DragonFly, Minix, Darwin, SmartOS systems.

Versions Report

 salt --versions-report
Salt Version:
           Salt: 2016.3.3

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.22
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.13 (default, Jan 17 2017, 20:03:18)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 14.4.1
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.3
            ZMQ: 4.1.4

System Versions:
           dist:   
        machine: x86_64
        release: 16.3.0
         system: Darwin
        version: 10.12.2 x86_64
Ch3LL commented 7 years ago

@mattwillsher If you add macos to that list does it then work?

Just run salt-call --local grains.get os to find out the exact string to add to that list. Thanks

mattwillsher commented 7 years ago

Sort of works. The module loads. However adding pkgin to the providers: {} minion config still results in homebrew being used. Both are on my system.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.