<commit_before># pillarstack

This custom saltstack `ext_pillar` is inspired by
[varstack](https://github.com/conversis/varstack) but is heavily based on
Jinja2 for maximum flexibility.

It supports the following features:
  - multiple config files that are jinja2 templates with support for `pillar`,
    `__grains__`, `__salt__`, `__opts__` objects
  - a config file renders as an ordered list of files (paths of these files are
    relative to the current config file)
  - this list of files are read in ordered as jinja2 templates with support for
    `stack`, `pillar`, `__grains__`, `__salt__`, `__opts__` objects
  - all these rendered files are then parsed as `yaml`
  - then all yaml dicts are merged in order with support for the following
    merging strategies: `merge-first`, `merge-last`, and `overwrite`

Installing the pillarstack `ext_pillar` is as simple as dropping the stack.py
file in the `<extensions_modules>/pillar` directory (no external python module
required).<commit_msg>add wording about new flexible configuration (select cfg file based on matchs)<commit_after># pillarstack

This custom saltstack `ext_pillar` is inspired by
[varstack](https://github.com/conversis/varstack) but is heavily based on
Jinja2 for maximum flexibility.

It supports the following features:
  - multiple config files that are jinja2 templates with support for `pillar`,
    `__grains__`, `__salt__`, `__opts__` objects
  - a config file renders as an ordered list of files (paths of these files are
    relative to the current config file)
  - this list of files are read in ordered as jinja2 templates with support for
    `stack`, `pillar`, `__grains__`, `__salt__`, `__opts__` objects
  - all these rendered files are then parsed as `yaml`
  - then all yaml dicts are merged in order with support for the following
    merging strategies: `merge-first`, `merge-last`, and `overwrite`
  - stack config files can be matched based on `pillar`, `grains`, or `opts`
    values, which make it possible to support kind of self-contained
    environments

Installing the pillarstack `ext_pillar` is as simple as dropping the stack.py
file in the `<extensions_modules>/pillar` directory (no external python module
required).
{'fraction_non_alphanumeric': 0.07232704402515723, 'fraction_numerical': 0.0026954177897574125, 'mean_word_length': 4.512376237623762, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5156357', 'n_tokens_mistral': 631, 'n_tokens_neox': 599, 'n_words': 291}