mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 18:08:21 +02:00
Certbot and Nginx disappeared in Ansible conf
This commit is contained in:
44
ansible/roles/5-nginx/tasks/main.yml
Normal file
44
ansible/roles/5-nginx/tasks/main.yml
Normal file
@ -0,0 +1,44 @@
|
||||
---
|
||||
- name: Install NGINX
|
||||
apt:
|
||||
name: nginx
|
||||
register: pkg_result
|
||||
retries: 3
|
||||
until: pkg_result is succeeded
|
||||
|
||||
- name: Copy conf of Nginx
|
||||
template:
|
||||
src: "nginx_note.conf"
|
||||
dest: /etc/nginx/sites-available/nginx_note.conf
|
||||
mode: 0644
|
||||
owner: www-data
|
||||
group: www-data
|
||||
|
||||
- name: Enable Nginx site
|
||||
file:
|
||||
src: /etc/nginx/sites-available/nginx_note.conf
|
||||
dest: /etc/nginx/sites-enabled/nginx_note.conf
|
||||
owner: www-data
|
||||
group: www-data
|
||||
state: link
|
||||
|
||||
- name: Disable default Nginx site
|
||||
file:
|
||||
dest: /etc/nginx/sites-enabled/default
|
||||
state: absent
|
||||
|
||||
- name: Copy conf of UWSGI
|
||||
file:
|
||||
src: /var/www/note_kfet/uwsgi_note.ini
|
||||
dest: /etc/uwsgi/apps-enabled/uwsgi_note.ini
|
||||
state: link
|
||||
|
||||
- name: Reload Nginx
|
||||
systemd:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
|
||||
- name: Restart UWSGI
|
||||
systemd:
|
||||
name: uwsgi
|
||||
state: restarted
|
Reference in New Issue
Block a user