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

45 lines
1,004 B
YAML
Raw Normal View History

2022-05-02 17:37:08 +02:00
- 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"
2022-05-17 15:45:42 +02:00
ansible.builtin.file:
2022-05-02 17:37:08 +02:00
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"
2022-05-17 15:45:42 +02:00
ansible.builtin.file:
2022-05-02 17:37:08 +02:00
path: "/var/www/{{ scope }}"
owner: www-data
group: www-data
2022-05-17 15:45:42 +02:00
mode: "0750"
2022-05-02 17:37:08 +02:00
state: directory