Добавить install_nginx.yml

This commit is contained in:
2026-02-07 22:57:55 +03:00
parent 7f80378970
commit d01a63f914

32
install_nginx.yml Normal file
View File

@@ -0,0 +1,32 @@
- hosts: all
become: true
tasks:
- name: update
apt:
update_cache: yes
- name: install nginx
apt:
name: nginx
notify: enabled nginx
- name: create config nginx
vars:
nginx_port: 8080
template:
src: nginx_template
dest: /etc/nginx/sites-available/default
notify: restart nginx
handlers:
- name: restart nginx
systemd:
name: nginx
state: restarted
- name: enabled nginx
systemd:
name: nginx
enabled: yes
state: started