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(tpldata): provide tplroot #51814

Merged
merged 4 commits into from
Jun 20, 2019
Merged

feat(tpldata): provide tplroot #51814

merged 4 commits into from
Jun 20, 2019

Commits on Feb 26, 2019

  1. docs(tpldir): use ~ for Jinja string concatenation

    * http://jinja.pocoo.org/docs/2.10/templates/#math -- re: `+`
      - "This, however, is not the preferred way to concatenate strings!"
    * http://jinja.pocoo.org/docs/2.10/templates/#other-operators -- re: `~`
      - "Converts all operands into strings and concatenates them."
    myii committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    3512513 View commit details
    Browse the repository at this point in the history
  2. feat(tpldata): provide tplroot

    Working on making SaltStack Formulas portable, find the need for a
    common point of reference.  Comparing the import of `map.jinja` with and
    without context:
    
    | `tpldata` | without context    | with context             |
    |-----------|--------------------|--------------------------|
    | `tplfile` | template/map.jinja | template/pkg/install.sls |
    | `tpldir`  | template           | template/pkg             |
    | `tpldot`  | template           | template.pkg             |
    | `tplroot` | template           | template                 |
    
    With `tplroot`, it is possible to use a single point of reference for
    all paths, avoiding the various incantations currently used, such as:
    
    * `from tpldir ~ "/map.jinja" import ...`
    * `from salt.file.dirname(tpldir) ~ "/map.jinja" import ...`
    * `from salt['file.dirname'](tpldir) ~ "/map.jinja" import ...`
    
    In all of the above circumstances, this simply becomes:
    
    * `from tplroot ~ "/map.jinja" import ...`
    
    Additional benefits are gained when referencing by colon `:` for pillars
    or by period `.` for `include` statements or for any requisites.
    
    Related issues: saltstack#10838, saltstack#41195.
    myii committed Feb 26, 2019
    Configuration menu
    Copy the full SHA
    da45aef View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2019

  1. Configuration menu
    Copy the full SHA
    13b7ee1 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2019

  1. Configuration menu
    Copy the full SHA
    799c887 View commit details
    Browse the repository at this point in the history