---
- name: Packages for nginx
  apt:
    name:
      - nginx
      - certbot
      - python3-certbot-nginx
    install_recommends: no

- name: no default nginx site
  notify: reload nginx
  file:
    path: /etc/nginx/sites-enabled/default
    state: absent

- name: nginx config
  notify: reload nginx
  template:
    dest: "/etc/nginx/sites-enabled/rosin.trygvis.io"
    src: etc/nginx/sites-enabled/rosin.j2

- name: docroot dir
  file:
    path: "/var/www/rosin"
    state: directory

#- name: docroot dir
#  copy:
#    dest: "/var/www/rosin/index.html"
#    src: "docroot/index.html"