infra/roles/nginx/tasks/main.ml

33 lines
727 B
OCaml
Raw Normal View History

2020-10-02 21:28:40 +02:00
---
2020-11-10 23:14:10 +01:00
- name: Install NGINX
become: yes
2020-10-02 21:28:40 +02:00
apt:
name: nginx
2020-11-10 23:14:10 +01:00
- 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