Добавить install_nginx.yml
This commit is contained in:
32
install_nginx.yml
Normal file
32
install_nginx.yml
Normal 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
|
||||
Reference in New Issue
Block a user