warpnet / salt-lint

A command-line utility that checks for best practices in SaltStack.
https://salt-lint.readthedocs.io/en/latest/
MIT License
154 stars 39 forks source link

Added rule: check that jinja template files have the correct extension #179

Closed chrisvanbreeden closed 4 years ago

jbouter commented 4 years ago

When using file.recurse, one might have jinja templates in there that can't be renamed to have the .j2 extension, because then they'll have that extension on filesystem.

For example:

nginx_vhosts:
  file.recurse:
    - name: /etc/nginx/sites-enabled/
    - source: salt://nginx/vhosts
    - template: jinja
    [..]

If /nginx/vhosts/ is filled with vhost.conf.j2 files, they will be put on the server's filesystem as vhost.conf.j2 files.

jbouter commented 4 years ago

First of all, thank you for your contribution!

We are, however, sadly closing this pull request due to the following reasons:

I suggest this PR is rewritten to do the following:

If you do wish however to use this code, you can use -r option to specify your own set of rules in your own SaltStack linting pipeline. But we won't be merging this into the codebase.