Tweak syntax and docs for vhosts config.

pull/74/head 1.9.5
Jeff Geerling 8 years ago
parent ee5cd31375
commit 23f92af920
  1. 14
      tasks/vhosts.yml

@ -4,15 +4,13 @@
path: "{{ nginx_default_vhost_path }}" path: "{{ nginx_default_vhost_path }}"
state: absent state: absent
when: nginx_remove_default_vhost when: nginx_remove_default_vhost
notify: notify: reload nginx
- reload nginx
- name: Create nginx_vhost_path directory. - name: Ensure nginx_vhost_path exists.
file: file:
path: "{{ nginx_vhost_path }}" path: "{{ nginx_vhost_path }}"
state: directory state: directory
notify: notify: reload nginx
- reload nginx
- name: Add managed vhost config file (if any vhosts are configured). - name: Add managed vhost config file (if any vhosts are configured).
template: template:
@ -20,13 +18,11 @@
dest: "{{ nginx_vhost_path }}/{{ nginx_vhosts_filename }}" dest: "{{ nginx_vhost_path }}/{{ nginx_vhosts_filename }}"
mode: 0644 mode: 0644
when: nginx_vhosts|length > 0 when: nginx_vhosts|length > 0
notify: notify: reload nginx
- reload nginx
- name: Remove managed vhost config file (if no vhosts are configured). - name: Remove managed vhost config file (if no vhosts are configured).
file: file:
path: "{{ nginx_vhost_path }}/{{ nginx_vhosts_filename }}" path: "{{ nginx_vhost_path }}/{{ nginx_vhosts_filename }}"
state: absent state: absent
when: nginx_vhosts|length == 0 when: nginx_vhosts|length == 0
notify: notify: reload nginx
- reload nginx