43 lines
955 B
YAML
43 lines
955 B
YAML
- 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"
|
|
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"
|
|
file:
|
|
path: "/var/www/{{ scope }}"
|
|
owner: www-data
|
|
group: www-data
|
|
state: directory
|