项目作者: gediminasz

项目描述 :
Tools for checking Salt state validity
高级语言: Python
项目地址: git://github.com/gediminasz/slskit.git
创建时间: 2019-08-10T13:09:19Z
项目社区:https://github.com/gediminasz/slskit

开源协议:

下载


slskit

  1. Usage: slskit [OPTIONS] COMMAND [ARGS]...
  2. Options:
  3. --version Show the version and exit.
  4. -c, --config TEXT path to slskit configuration file (default:
  5. slskit.yaml or slskit.yml)
  6. -l, --log-level [CRITICAL|FATAL|ERROR|WARN|WARNING|INFO|DEBUG|NOTSET|VERBOSE|QUIET|PROFILE|TRACE|GARBAGE]
  7. --salt-output TEXT Alternative Salt outputter, e.g. nested,
  8. json, yaml, etc.
  9. --help Show this message and exit.
  10. Commands:
  11. highstate render highstate for specified minions
  12. pillars render pillar items for specified minions
  13. refresh invoke saltutil.sync_all runner
  14. sls render a given sls for specified minions
  15. template render a file template for specified minions
  • Supported Python versions: 3.9.2, 3.10, 3.11, 3.12.5
  • Supported Salt versions: 3006, 3007

Known issues:


Workaround for OpenSSL issues on macOS

If slskit is failing with an error like this: OSError: Cannot locate OpenSSL libcrypto, try setting the following environment variable:

  1. export HOMEBREW_PREFIX=/usr/local

Below is an old hackaround:

If slskit fails with zsh: abort or Abort trap: 6, inspect the error by running the command with PYTHONDEVMODE=1. If the issue is with _load_libcrypto call in rsax931.py, edit salt/utils/rsax931.py line 38:

  1. -lib = find_library('crypto')
  2. +lib = "/usr/local/opt/openssl@1.1/lib/libcrypto.dylib"

More info:

Workaround for exception raised when processing virtual function

When seeing errors like these:

  1. ERROR:salt.loader:Exception raised when processing __virtual__ function for salt.loaded.int.module.freebsdkmod. Module will not be loaded: 'kernel'
  2. WARNING:salt.loader:salt.loaded.int.module.freebsdkmod.__virtual__() is wrongly returning `None`. It should either return `True`, `False` or a new name. If you're the developer of the module 'freebsdkmod', please fix this.

You may need to add a corresponding grain to slskit.yaml file, e.g.:

  1. # slskit.yaml
  2. slskit:
  3. roster:
  4. foo:
  5. grains:
  6. kernel: Linux

You can find values for grains by inspecting grains.items on your real minions.

How to keep your grains DRY

Use default_grains option to avoid duplicating the same grains over all minions:

  1. # slskit.yaml
  2. slskit:
  3. roster:
  4. foo:
  5. bar:
  6. baz:
  7. default_grains:
  8. os: Ubuntu

For more advanced cases use YAML anchors:

  1. # slskit.yaml
  2. _grains:
  3. ubuntu: &ubuntu
  4. os: Ubuntu
  5. fedora: &fedora
  6. os: Fedora
  7. slskit:
  8. roster:
  9. u1:
  10. grains:
  11. <<: *ubuntu
  12. u2:
  13. grains:
  14. <<: *ubuntu
  15. f1:
  16. grains:
  17. <<: *fedora
  18. f2:
  19. grains:
  20. <<: *fedora

How to reduce output verbosity

Use Salt’s output configuration option, e.g.:

  1. # slskit.yaml
  2. salt:
  3. output: yaml
  4. slskit:
  5. ...