mastible/roles/mastodon-nginx/tasks/main.yml
2019-01-12 15:30:24 -05:00

25 lines
733 B
YAML

---
# This role install nginx, configures it
- name: Install nginx and socat
apt: name={{ item }} state=latest update_cache=yes
with_items:
- nginx
- socat
- name: Run nginx install tasks
include_tasks: install.yml
when: install is defined
- 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
template:
src: mastodon-nginx.conf
dest: /etc/nginx/sites-available/{{ LOCAL_DOMAIN }}.conf
- name: Enable Mastodon nginx vhost template
file:
src: /etc/nginx/sites-available/{{ LOCAL_DOMAIN }}.conf
dest: /etc/nginx/sites-enabled/{{ LOCAL_DOMAIN }}.conf
state: link