diff --git a/ansible/roles/nginx/tasks/main.yml b/ansible/roles/nginx/tasks/main.yml index fb9c2fb..6cdb358 100644 --- a/ansible/roles/nginx/tasks/main.yml +++ b/ansible/roles/nginx/tasks/main.yml @@ -4,6 +4,13 @@ become: true template: src: books.vvvvvvaria.org.j2 - dest: /etc/nginx/sites-available/ + dest: /etc/nginx/sites-available/books.vvvvvvaria.conf mode: 0644 notify: Reload Nginx. + +- name: Symlink the configuration into the enabled folder. + become: true + file: + src: /etc/nginx/sites-available/books.vvvvvvaria.conf + path: /etc/nginx/sites-enabled/books.vvvvvvaria.conf + state: link diff --git a/ansible/roles/nginx/templates/books.vvvvvvaria.org.j2 b/ansible/roles/nginx/templates/books.vvvvvvaria.org.j2 index ec1562b..9bdc11a 100644 --- a/ansible/roles/nginx/templates/books.vvvvvvaria.org.j2 +++ b/ansible/roles/nginx/templates/books.vvvvvvaria.org.j2 @@ -18,6 +18,9 @@ server { error_log /var/log/nginx/books.vvvvvvaria.org.log; location / { + auth_basic "Congrats! You've reached a members only portion of the site!"; + auth_basic_user_file /etc/nginx/.htpasswd; + proxy_bind $server_addr; proxy_pass http://127.0.0.1:5000; proxy_set_header Host $http_host; diff --git a/ansible/roles/supervisor/tasks/main.yml b/ansible/roles/supervisor/tasks/main.yml index c0ec6fc..a868ebe 100644 --- a/ansible/roles/supervisor/tasks/main.yml +++ b/ansible/roles/supervisor/tasks/main.yml @@ -26,3 +26,9 @@ name: supervisor state: started enabled: true + +- name: Ensure the XPPL group is running. + become: true + supervisorctl: + name: 'xppl:' + state: started