https://github.com/catvec/salt-pillar-linter
Lints Salt states and their use of pillars. Only Jinja supported.
https://github.com/catvec/salt-pillar-linter
devops linting saltstack
Last synced: about 1 month ago
JSON representation
Lints Salt states and their use of pillars. Only Jinja supported.
- Host: GitHub
- URL: https://github.com/catvec/salt-pillar-linter
- Owner: catvec
- License: mit
- Created: 2019-02-24T19:29:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-29T01:29:15.000Z (about 7 years ago)
- Last Synced: 2025-09-08T00:47:01.902Z (9 months ago)
- Topics: devops, linting, saltstack
- Language: Python
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Salt Pillar Linter
Lints Salt states and their use of pillars. Only Jinja supported.
# Table Of Contents
- [Overview](#overview)
- [Install](#install)
# Overview
Lints Salt states to ensure they are using Pillar keys which exist.
This project exists because at times it can be challenging to debug Jinja
render errors.
Only works with fairly standard Salt state setups which use Jinja and plain
text pillars in SLS files.
Usage:
```
usage: salt-pillar-linter [-h] -p PILLARS_ROOT -s STATES_ROOT
[-f TMPL_FILE] [-d]
Lints Salt states to ensure pillars are used correctly
optional arguments:
-h, --help show this help message and exit
-p PILLARS_ROOT Directories where pillars are present, can be specified
multiple times
-s STATES_ROOT Directories where states are located, can be specified
multiple times
-f TMPL_FILE Non state files which uses Jinja templating to check, can
be specified multiple times
-d Print additional debug information
```
Sample output:
```
% salt-pillar-linter -p pillar -s salt
salt/foo/init.sls uses pillar keys which do not exist
Line 151:
foo.bar.config_file
```
# Install
1. Clone down the repository
2. Install dependencies
- [Pipenv](https://pipenv.readthedocs.io/en/latest/) is used to manage
a virtual environment used by Salt Pillar Linter.
- Install dependencies by running `pipenv install`
3. Add repository directory to `PATH`
4. Invoke `salt-pillar-linter`