added map.jinja support

This commit is contained in:
Marc Schiffbauer 2015-02-26 16:19:08 +01:00 committed by Marc Schiffbauer
parent d13d7f7519
commit 6f85a25336
2 changed files with 21 additions and 4 deletions

View File

@ -1,5 +1,15 @@
{% from "postfix/map.jinja" import postfix with context %}
postfix: postfix:
pkg.installed: [] {% if postfix.packages is defined %}
pkg.installed:
- names:
{% for name in postfix.packages %}
- {{ name }}
{% endfor %}
- watch_in:
- service: postfix
{% endif %}
service.running: service.running:
- enable: True - enable: True
- require: - require:
@ -7,9 +17,6 @@ postfix:
- watch: - watch:
- pkg: postfix - pkg: postfix
postfix-policyd-spf-python:
pkg.installed: []
# manage /etc/aliases if data found in pillar # manage /etc/aliases if data found in pillar
{% if 'aliases' in pillar.get('postfix', '') %} {% if 'aliases' in pillar.get('postfix', '') %}
/etc/aliases: /etc/aliases:

10
postfix/map.jinja Normal file
View File

@ -0,0 +1,10 @@
{% set postfix = salt['grains.filter_by']({
'Debian': {
'packages': ['postfix', 'postfix-policyd-spf-python'],
'service': 'postfix',
},
'Gentoo': {
'packages': ['mail-mta/postfix'],
'service': 'postfix',
},
}, merge=salt['pillar.get']('postfix:lookup')) %}