Commit 72c46989 by Bilal

Adding support for multiple auth credentials for nginx (OPS-952)

parent d6667399
...@@ -10,6 +10,15 @@ NGINX_EDXAPP_EXTRA_SITES: [] ...@@ -10,6 +10,15 @@ NGINX_EDXAPP_EXTRA_SITES: []
NGINX_EDXAPP_EXTRA_CONFIGS: [] NGINX_EDXAPP_EXTRA_CONFIGS: []
NGINX_EDXAPP_CUSTOM_REDIRECTS: {} NGINX_EDXAPP_CUSTOM_REDIRECTS: {}
# Override these vars for adding user to nginx.htpasswd
nginxusers:
- name: "{{ COMMON_HTPASSWD_USER }}"
password: "{{ COMMON_HTPASSWD_PASS }}"
state: present
- name: bilal
password: edx
state: absent
NGINX_ENABLE_SSL: False NGINX_ENABLE_SSL: False
NGINX_REDIRECT_TO_HTTPS: False NGINX_REDIRECT_TO_HTTPS: False
# Set these to real paths on your # Set these to real paths on your
......
...@@ -223,13 +223,15 @@ ...@@ -223,13 +223,15 @@
- name: Write out htpasswd file - name: Write out htpasswd file
htpasswd: > htpasswd: >
name={{ COMMON_HTPASSWD_USER }} name={{ item.name }}
password={{ COMMON_HTPASSWD_PASS }} password={{ item.password }}
state={{ item.state }}
path={{ nginx_htpasswd_file }} path={{ nginx_htpasswd_file }}
when: COMMON_ENABLE_BASIC_AUTH when: COMMON_ENABLE_BASIC_AUTH
tags: tags:
- install - install
- install:configuration - install:configuration
with_items: nginxusers
- name: Create nginx log file location (just in case) - name: Create nginx log file location (just in case)
file: > file: >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment