xoxys.nginx/tasks/config.yml

38 lines
666 B
YAML

---
- name: Enable nginx service
service:
name: nginx
enabled: yes
state: started
- name: Prepare directories
file:
path: /var/www/vhosts
state: directory
owner: nginx
group: nginx
mode: 0750
- name: Update nginx.conf
template:
src: 'etc/nginx/nginx.conf.j2'
dest: '/etc/nginx/nginx.conf'
owner: root
group: root
mode: 0640
notify:
- nginx_restart
- name: Update conf.d files
template:
src: 'etc/nginx/conf.d/{{ item }}.j2'
dest: '/etc/nginx/conf.d/{{ item }}'
owner: root
group: root
mode: 0640
with_items:
- deafult.conf
- header.conf
notify:
- nginx_restart