b470a1b496
* Re-organize according to http://docs.saltstack.com/topics/conventions/formulas.html#writing-formulas
21 lines
471 B
Plaintext
21 lines
471 B
Plaintext
{% set nginx = pillar.get('nginx', {}) -%}
|
|
{% set htauth = nginx.get('htpasswd', '/etc/nginx/.htpasswd') -%}
|
|
|
|
htpasswd:
|
|
pkg.installed:
|
|
- name: apache2-utils
|
|
|
|
{% for name, user in pillar.get('users', {}).items() %}
|
|
{% if user['webauth'] is defined -%}
|
|
|
|
nginx_user_{{name}}:
|
|
module.run:
|
|
- name: basicauth.adduser
|
|
- user: {{ name }}
|
|
- passwd: {{ user['webauth'] }}
|
|
- path: {{ htauth }}
|
|
- require:
|
|
- pkg: htpasswd
|
|
|
|
{% endif -%}
|
|
{% endfor %} |