infra/roles/nginx/tasks/main.ml
2020-11-10 23:14:10 +01:00

32 lines
727 B
OCaml

---
- name: Install NGINX
become: yes
apt:
name: nginx
- name: Disable NGINX Default Virtual Host
become: yes
file:
src: /etc/nginx/sites-enabled/default
state: unlink
- name: Configure Reverse Proxies
become: yes
template:
src: reverse_proxy.conf
dest: /etc/nginx/sites-available/reverse_proxy_{{item.key}}.conf
with_dict: "{{ proxies }}"
- name: Link NGINX Reverse Proxies
file:
src: "/etc/nginx/sites-available/reverse_proxy_{{item.key}}.conf"
dest: "/etc/nginx/sites-enabled/reverse_proxy_{{item.key}}.conf"
state: link
with_dict: "{{ proxies }}"
- name: Make sure NGINX Service is running
become: yes
service:
name: nginx
state: restarted
enabled: yes