mirror of
https://github.com/saltstack-formulas/template-formula.git
synced 2025-04-17 10:10:28 +00:00
Merge d2c9228422
into e3d3c121ef
This commit is contained in:
commit
9ae7b7aee7
15 changed files with 19 additions and 19 deletions
|
@ -3,7 +3,7 @@
|
|||
---
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split("/")[0] %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata with context %}
|
||||
|
||||
{%- set _mapdata = {
|
||||
"values": mapdata,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
|
||||
include:
|
||||
- {{ sls_service_clean }}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- set sls_package_install = tplroot ~ '.package.install' %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/libtofs.jinja" import files_switch with context %}
|
||||
|
||||
include:
|
||||
- {{ sls_package_install }}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split("/")[0] %}
|
||||
{%- from tplroot ~ "/libmatchers.jinja" import parse_matchers, query_map with context %}
|
||||
{%- from tplroot ~ "/libs/libmatchers.jinja" import parse_matchers, query_map with context %}
|
||||
|
||||
{%- set _default_config_dirs = [
|
||||
"parameters/",
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split("/")[0] %}
|
||||
{%- from tplroot ~ "/libsaltcli.jinja" import cli with context %}
|
||||
{%- from tplroot ~ "/libs/libsaltcli.jinja" import cli with context %}
|
||||
|
||||
{%- set query_map = {
|
||||
"C": "config.get",
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split("/")[0] %}
|
||||
{%- from tplroot ~ "/libmapstack.jinja" import mapstack with context %}
|
||||
{%- from tplroot ~ "/libs/libmapstack.jinja" import mapstack with context %}
|
||||
|
||||
{#- Where to lookup parameters source files #}
|
||||
{%- set formula_param_dir = tplroot ~ "/parameters" %}
|
||||
|
@ -63,4 +63,4 @@
|
|||
|
||||
{#- Per formula post-processing of `mapdata` if it exists #}
|
||||
{%- do salt["log.debug"]("map.jinja: post-processing of 'mapdata'") %}
|
||||
{%- include tplroot ~ "/post-map.jinja" ignore missing %}
|
||||
{%- include formula_param_dir ~ "/post-map.jinja" ignore missing %}
|
|
@ -4,7 +4,7 @@
|
|||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- set sls_config_clean = tplroot ~ '.config.clean' %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
|
||||
include:
|
||||
- {{ sls_config_clean }}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
|
||||
TEMPLATE-package-install-pkg-installed:
|
||||
pkg.installed:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
|
||||
TEMPLATE-service-clean-service-dead:
|
||||
service.dead:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- set sls_config_file = tplroot ~ '.config.file' %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
|
||||
include:
|
||||
- {{ sls_config_file }}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
|
||||
include:
|
||||
- {{ sls_service_clean }}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- set sls_config_file = tplroot ~ '.config.file' %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/libtofs.jinja" import files_switch with context %}
|
||||
|
||||
include:
|
||||
- {{ sls_config_file }}
|
||||
|
|
|
@ -293,7 +293,7 @@ The ``map.jinja`` file aggregates configuration values from several sources:
|
|||
|
||||
For the values loaded from YAML files, ``map.jinja`` will automatically try to load a Jinja2 template with the same name as the YAML file with the addition of the ``.jinja`` extension, for example ``foo/bar/quux.yaml.jinja``.
|
||||
|
||||
After loading values from all sources, it will try to include the ``salt://{{ tplroot }}/post-map.jinja`` Jinja file if it exists which can post-process the ``mapdata`` variable.
|
||||
After loading values from all sources, it will try to include the ``salt://{{ tplroot }}/parameters/post-map.jinja`` Jinja file if it exists which can post-process the ``mapdata`` variable.
|
||||
|
||||
Configuring ``map.jinja`` sources
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -458,7 +458,7 @@ Here is the best way to use it in an ``sls`` file:
|
|||
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split("/")[0] %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
|
||||
test-does-nothing-but-display-TEMPLATE-as-json:
|
||||
test.nop:
|
||||
|
@ -480,8 +480,8 @@ Here is an example based on `template-formula/TEMPLATE/config/file.sls`_:
|
|||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- set sls_package_install = tplroot ~ '.package.install' %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
|
||||
{%- from tplroot ~ "/libs/map.jinja" import mapdata as TEMPLATE with context %}
|
||||
{%- from tplroot ~ "/libs/libtofs.jinja" import files_switch with context %}
|
||||
|
||||
include:
|
||||
- {{ sls_package_install }}
|
||||
|
|
Loading…
Add table
Reference in a new issue