- name: "Install dependencies" ansible.builtin.apt: name: "nginx" update_cache: true cache_valid_time: 86400 - name: "Add gzip snippet" ansible.builtin.template: src: gzip.conf dest: "/etc/nginx/snippets/gzip.conf" mode: "0640" notify: - Reload Nginx - name: "Setup Vhost" ansible.builtin.template: src: "vhost.conf" dest: "/etc/nginx/sites-available/projectsend-{{ scope }}.conf" mode: "0640" notify: - Reload Nginx - name: "Disable default" ansible.builtin.file: path: "/etc/nginx/sites-enabled/default" state: absent notify: - Reload Nginx - name: "Enable Vhost" ansible.builtin.file: src: "/etc/nginx/sites-available/projectsend-{{ scope }}.conf" dest: "/etc/nginx/sites-enabled/projectsend-{{ scope }}.conf" state: link notify: - Reload Nginx - name: "Create base dir" ansible.builtin.file: path: "/var/www/{{ scope }}" owner: www-data group: www-data mode: "0750" state: directory