---
- debug:
    msg: "Hostname: {{ mastodon_host | default(ansible_fqdn) }}"

- name: mastodon | Copy nginx config
  template: 
    src: mastodon.conf.j2
    dest: /etc/nginx/sites-available/mastodon.conf
  notify: restart_nginx
  
- name: mastodon | Symlink enabled site
  file:
    src: "/etc/nginx/sites-available/mastodon.conf"
    dest: "/etc/nginx/sites-enabled/mastodon.conf"
    state: link
  notify: restart_nginx