Skip to content

Instantly share code, notes, and snippets.

@skinny
Last active August 12, 2020 12:58
Show Gist options
  • Save skinny/6542ee1d42b4f1c7d095134bbdf51b02 to your computer and use it in GitHub Desktop.
Save skinny/6542ee1d42b4f1c7d095134bbdf51b02 to your computer and use it in GitHub Desktop.
stationmap.yaml :
'1815-1991-7288-3225-9558-4541-07':
station-id: 19
organizationunit-id: 15
country-id: 'NL'
map.jinja :
{%- set tplroot = tpldir.split('/')[0] %}
{%- import_yaml tpldir + "/stationmap.yaml" as stationmap %}
{%- set station = salt['grains.filter_by'](
stationmap,
grain='serialnumber',
default='1815-1991-7288-3225-9558-4541-07'
)
%}
init.sls :
{% from tpldir + "/map.jinja" import station with context %}
/etc/eva/station.conf:
file.managed:
- makedirs: True
- source: salt://config/station.conf
- context:
station: station
- mode: 644
- template: jinja
station.conf:
{{ station['country-id'] }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment