Skip to content

Instantly share code, notes, and snippets.

Created August 28, 2017 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5437e75a26702eabf9ea59eb11158cdb to your computer and use it in GitHub Desktop.
Save anonymous/5437e75a26702eabf9ea59eb11158cdb to your computer and use it in GitHub Desktop.
### pillar file:
tibco:
ems: data from pillar file
mdm:
a: from pillar
### data file.yaml -> will be stored in the variable ed
tibco:
ems: from yaml
mdm:
a: data from yaml
### STATE FILE
{% import_yaml 'data.yaml' as ed %} # external data
{%- set np = salt['pillar.get']('tibco', ed.tibco, merge=true) %} # new pillar
file_edit:
file.blockreplace:
- name: /root/.bashrc
- append_if_not_found: True
- marker_start: "### SALTSTACK BLOCK START ###"
- marker_end: "### SALTSTACK BLOCK END ###"
- content: |
# {{ np.ems }} -> this gets the data from pillar not from data.yaml
# {{ np.mdm.a }} -> this gets the data from pillar not from data.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment