ansible-pet/1/roles/nginx/tasks/configure.yml

32 lines
695 B
YAML
Raw Normal View History

2021-02-27 15:01:00 +03:00
---
- name: install nginx config
template:
src: files/nginx.conf
dest: /etc/nginx/nginx.conf
owner: www-data
- name: remove default config
file:
path: /etc/nginx/sites-enabled/default
state: absent
owner: www-data
- name: install site's configs
template:
src: files/sites-enabled/{{ item }}
dest: /etc/nginx/sites-enabled/{{ item }}
owner: www-data
loop: ['wiki.conf', 'root.conf', 'pma.conf', 'default_server.conf', 'cloud.conf']
- name: create dirs
file:
path: /var/www/{{item}}
state: directory
owner: www-data
loop: ['pma','cloud','wiki','default','root']
- name: reload nginx
service:
name: nginx
state: reloaded