Merge pull request #2 from evvers/master

Add map.jinja
This commit is contained in:
Forrest 2014-02-16 15:54:34 -07:00
commit 9bd10044b8
2 changed files with 11 additions and 6 deletions

View file

@ -1,12 +1,10 @@
foo-common:
pkg.installed
{% from "template/map.jinja" import template with context %}
{% if grains['id'] == pillar['template']['master'] %}
foo-service:
template:
pkg:
- installed
- name: {{ template.pkg }}
service:
- running
- name: {{ template.service }}
- enable: True
{% endif %}

7
template/map.jinja Normal file
View file

@ -0,0 +1,7 @@
{% set template = salt['grains.filter_by']({
'default': {
'pkg': 'template',
'service': 'template',
'config': '/etc/template.conf',
},
}, merge=salt['pillar.get']('template:lookup')) %}