xoxys.nginx/tasks/vhost.yml

25 lines
609 B
YAML
Raw Normal View History

2018-08-12 19:42:13 +00:00
---
- block:
- name: Add default page configuration file
template:
src: etc/nginx/sites-available/vhost.j2
dest: "/etc/nginx/sites-available/{{ item.key }}"
owner: root
group: root
mode: 0640
with_dict: nginx_vhosts
notify: __nginx_reload
- name: Enable default page
file:
src: "/etc/nginx/sites-available/{{ item.key }}"
dest: "/etc/nginx/sites-enabled/{{ item.key }}"
owner: root
group: root
state: link
with_dict: nginx_vhosts
notify: __nginx_reload
when: nginx_vhosts is defined
become: True
become_user: root