Saltstack Official Nginx Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

21 行
493B

  1. {% from "nginx/map.jinja" import nginx with context %}
  2. {% set htauth = nginx.get('htpasswd', '/etc/nginx/.htpasswd') -%}
  3. htpasswd:
  4. pkg.installed:
  5. - name: {{ nginx.apache_utils }}
  6. {% for name, user in pillar.get('users', {}).items() %}
  7. {% if user['webauth'] is defined -%}
  8. nginx_user_{{name}}:
  9. module.run:
  10. - name: basicauth.adduser
  11. - user: {{ name }}
  12. - passwd: {{ user['webauth'] }}
  13. - path: {{ htauth }}
  14. - require:
  15. - pkg: htpasswd
  16. {% endif -%}
  17. {% endfor %}