From a03ece8de422dfaf8b6ee9662e5b63f6162dbef7 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 18 Jun 2014 11:57:05 +0200 Subject: [PATCH] Added map file to resolve apache utils package name --- nginx/map.jinja | 8 ++++++++ nginx/users.sls | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 nginx/map.jinja diff --git a/nginx/map.jinja b/nginx/map.jinja new file mode 100644 index 0000000..74b80e2 --- /dev/null +++ b/nginx/map.jinja @@ -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')) %} \ No newline at end of file diff --git a/nginx/users.sls b/nginx/users.sls index 775410a..f5fa508 100644 --- a/nginx/users.sls +++ b/nginx/users.sls @@ -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 -%}