Added map file to resolve apache utils package name

This commit is contained in:
root 2014-06-18 11:57:05 +02:00
parent a0a272d819
commit a03ece8de4
2 changed files with 10 additions and 2 deletions

8
nginx/map.jinja Normal file
View File

@ -0,0 +1,8 @@
{% set nginx = salt['grains.filter_by']({
'Debian': {
'apache_utils': 'apache2-utils',
},
'RedHat': {
'apache_utils': 'httpd-tools',
},
}, merge=salt['pillar.get']('nginx:lookup')) %}

View File

@ -1,9 +1,9 @@
{% set nginx = pillar.get('nginx', {}) -%}
{% from "nginx/map.jinja" import nginx with context %}
{% set htauth = nginx.get('htpasswd', '/etc/nginx/.htpasswd') -%}
htpasswd:
pkg.installed:
- name: apache2-utils
- name: {{ nginx.apache_utils }}
{% for name, user in pillar.get('users', {}).items() %}
{% if user['webauth'] is defined -%}