Salt centric fork of https://github.com/madduck/reclass with support for jinja, salt objects, and other options
Olivier Mauras c30ee2bc09 Clean things in functions 1 year ago
doc Prepare 1.4.1 release 3 years ago
examples Beef up the example inventory 4 years ago
reclass Clean things in functions 1 year ago
salt-master Move pillar/tops adapters 1 year ago
.gitignore .gitignore cleanup 5 years ago
.pylintrc Add pylintrc and Makefile for easier linting 5 years ago
ChangeLog.rst Add a changelog to documenation 5 years ago
LICENSE Add Artistic Licence 2.0 text 5 years ago
MANIFEST.in set up reclass for packaging on pypi 1 year ago
Makefile Assume github remote is called origin 5 years ago
README.md Document new ignore_*_notfound features 1 year ago
reclass.py Massive refactoring 5 years ago
requirements.txt set up reclass for packaging on pypi 1 year ago
run_tests.py Switch to Python unittest 5 years ago
setup.cfg set up reclass for packaging on pypi 1 year ago
setup.py Change README path in setup.py 1 year ago
tox.ini set up reclass for packaging on pypi 1 year ago

README.md

reclass-salt

This fork of reclass is very much salt centric and adds the following features:

  • Allow jinja2 templating of reclass yaml definitions
  • Propagate pillars by default
  • Pass the following salt objects to reclass to be usable in templates
    • __opts__
    • __salt__
    • __grains__
  • Add 2 new options to ignore missing node and class
    • ignore_node_notfound
    • ignore_class_notfound

Installation

pip install . or pip install --upgrade . if original reclass is already installed.

Once installed, you should overwrite the default reclass_adapter.py provided by salt.
cp salt-master/pillar/reclass_adapter.py $PYTHONPATH/site-packages/salt/pillar
cp salt-master/tops/reclass_adapter.py $PYTHONPATH/site-packages/salt/tops

Usage

The official reclass documentation is available at http://reclass.pantsfullofunix.net

Example:

# /srv/reclass/nodes/saltmaster.domain.yml

environment: prod

classes:
{% for class in ['default', 'app1'] %}
  - {{ class }}
{% endfor %}

parameters:
  default:
    network:
      dns:
        srv3: 192.168.1.1
    os: {{ __grains__['oscodename'] }}

What's broken

  • Ansible and Puppet support
  • CLI as not aware of the salt objects - WIP