2017-11-26 23:03:27 +00:00
|
|
|
---
|
2018-08-23 20:53:25 +00:00
|
|
|
# This role install nginx, configures it
|
2017-11-26 23:03:27 +00:00
|
|
|
|
2019-01-12 20:30:16 +00:00
|
|
|
- name: Install nginx and socat
|
2017-11-26 23:03:27 +00:00
|
|
|
apt: name={{ item }} state=latest update_cache=yes
|
|
|
|
with_items:
|
|
|
|
- nginx
|
2019-01-12 20:30:16 +00:00
|
|
|
- socat
|
2019-01-12 20:16:28 +00:00
|
|
|
- name: Run nginx install tasks
|
|
|
|
include_tasks: install.yml
|
|
|
|
when: install is defined
|
2017-11-26 23:03:27 +00:00
|
|
|
- name: Remove default nginx config in sites-enabled
|
|
|
|
file:
|
|
|
|
path: /etc/nginx/sites-enabled/default
|
|
|
|
state: absent
|
|
|
|
- name: Copy Mastodon nginx vhost template to sites-available
|
2017-11-26 23:11:14 +00:00
|
|
|
template:
|
2017-11-26 23:03:27 +00:00
|
|
|
src: mastodon-nginx.conf
|
2018-08-22 08:16:54 +00:00
|
|
|
dest: /etc/nginx/sites-available/{{ LOCAL_DOMAIN }}.conf
|
2017-11-26 23:03:27 +00:00
|
|
|
- name: Enable Mastodon nginx vhost template
|
|
|
|
file:
|
2018-08-22 08:16:54 +00:00
|
|
|
src: /etc/nginx/sites-available/{{ LOCAL_DOMAIN }}.conf
|
|
|
|
dest: /etc/nginx/sites-enabled/{{ LOCAL_DOMAIN }}.conf
|
2017-11-26 23:03:27 +00:00
|
|
|
state: link
|