- 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"
src: "vhost.conf"
dest: "/etc/nginx/sites-available/projectsend-{{ scope }}.conf"
- name: "Disable default"
ansible.builtin.file:
path: "/etc/nginx/sites-enabled/default"
state: absent
- name: "Enable Vhost"
src: "/etc/nginx/sites-available/projectsend-{{ scope }}.conf"
dest: "/etc/nginx/sites-enabled/projectsend-{{ scope }}.conf"
state: link
- name: "Create base dir"
path: "/var/www/{{ scope }}"
owner: www-data
group: www-data
mode: "0750"
state: directory