nmadhok / spm

A (experimental) Salt Package Manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SPM: A Salt Package Manager

Summary

Allow salt users to pull down packages of formulas, modules, returners, or remove the associated files.

Benefits

  1. Encourages developers to write robust and isolated reuseable packages
  2. Easy to keep track of what came from where, what is currently being used

Installation

Installation using Git:

git clone https://github.com/nmadhok/spm.git
cd spm
sudo python setup.py install

More Information

  1. The package gets copied to a local packages directory in /etc/salt/spm/pkgs

  2. SPM reads the package's MANIFEST file, which points to the location of different salt components. Where the list values such as pkg_modules/ represent relative paths to the package's root folder:

    modules:
      - pkg_modules/
    states:
      - pkg_states/
    formulas:
      - pkgname/
    ...
    
  3. SPM symlinks the paths from the MANIFEST into the appropriate places in the file_root and pillar_root:

    /etc/salt/spm/pkgs/pkgname/pkg_modules/ -> /srv/salt/_modules/pkgname/pkg_modules/
    /etc/salt/spm/pkgs/pkgname/pkgname/ -> /srv/salt/pkgname/
    

Background

SPM has to do some discovery ground work to figure out where to place modules, formulas, and pillars. It does this by using the salt Loader to analyze the master config, or if not available the minion config.

Best Practices

Package maintainers should put all configuration into pillar values. The package should include an example pillar file with comment documentation explaining each of the parameters.

About

A (experimental) Salt Package Manager

License:MIT License


Languages

Language:Python 100.0%