1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
Ansible_Project/roles/nginx/tasks/main.yml
2022-05-02 17:37:08 +02:00

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