Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(map): update to v5 map.jinja #225

Merged

Commits on Feb 15, 2021

  1. fix(inspec): validate map.jinja configuration

    Update `_mapdata` reference files to include the `map.jinja`
    configuration sources.
    baby-gnu committed Feb 15, 2021
    Configuration menu
    Copy the full SHA
    41d222e View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2021

  1. feat(map): update to v5 map.jinja

    The v5 `map.jinja` is a generic and configurable system to load
    configuration values, exposed as the `mapdata` variable, from
    different places:
    
    - YAML files and templates from the fileserver for non-secret data
    - pillars or SDB are preferred for secret data
    - grains or `config.get`
    
    The `map.jinja` optional sources are configured with compound targeting like
    syntax `[<TYPE>[:<OPTION>[:<DELIMITER>]]@]<KEY>` with the following
    default ordered sources:
    
    - `Y:G@osarch`: YAML file and Jinja template named after `osarch` grain
    - `Y:G@os_family`: YAML file and Jinja template named after `os_family` grain
    - `Y:G@os` YAML file and Jinja template named after `os` grain
    - `Y:G@osfinger` YAML file and Jinja template named after `osfinger` grain
    - `C@{{ tplroot ~ ':lookup' }}`: dict retrieved with `salt["config.get"]`
    - `C@{{ tplroot }}`: dict retrieved with `salt["config.get"]`
    - `Y:G@id`: YAML file and Jinja template named after `osarch` grain
    
    This is done by two new libraries:
    
    - `libmatchers.jinja` provides the `parse_matchers` macro to parse
      strings looking like compound matchers, for example `Y:G@osarch`
    
    - `libmapstack.jinja` provides the `mapstack` macro to load
      configuration from different sources described by matchers
    
    Post-processing of `mapdata` variable can be done in a `parameters/post-map.jinja`.
    
    The v5 `map.jinja` is documented in `docs/map.jinja.rst`.
    
    BREAKING CHANGE: `map.jinja` now exports a generic `mapdata` variable
    
    BREAKING CHANGE: The per grain parameter values are now under `TEMPLATE/parameters/`
    baby-gnu committed Feb 16, 2021
    Configuration menu
    Copy the full SHA
    42e1932 View commit details
    Browse the repository at this point in the history