2022-08-30 11:54:38 +00:00
|
|
|
---
|
|
|
|
- name: configure virtual hosts
|
|
|
|
block:
|
|
|
|
- name: create webroot
|
|
|
|
file:
|
2024-04-14 22:53:26 +00:00
|
|
|
path: "{{ server.root }}"
|
2022-08-30 11:54:38 +00:00
|
|
|
state: directory
|
2024-04-14 22:53:26 +00:00
|
|
|
loop: "{{ item.value.server }}"
|
2022-08-30 11:54:38 +00:00
|
|
|
loop_control:
|
2024-04-14 22:53:26 +00:00
|
|
|
loop_var: server
|
2022-08-30 11:54:38 +00:00
|
|
|
|
|
|
|
- name: configure virtual host
|
|
|
|
template:
|
|
|
|
src: vhost.conf.j2
|
|
|
|
dest: "{{ nginx_conf_d_path }}/{{ item.key }}.conf"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0444
|
|
|
|
notify: reload nginx
|
|
|
|
loop: "{{ nginx_vhosts | dict2items }}"
|