You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
ansible-role-nginx/tasks/vhosts.yml

35 lines
1.0 KiB

---
- name: Creates Nginx conf directories
file: path={{ nginx_vhost_path }} state=directory mode=0755 recurse=yes
when: nginx_vhosts|length > 0
- name: Remove default nginx vhost config file (if configured).
file:
path: "{{ nginx_default_vhost_path }}"
state: absent
when: nginx_remove_default_vhost
notify:
- reload nginx
- name: Add managed vhost config file (if any vhosts are configured).
template:
src: vhosts.j2
dest: "{{ nginx_vhost_path }}/{{ nginx_vhosts_filename }}"
mode: 0644
when: nginx_vhosts|length > 0
notify:
- reload nginx
- name: Creates Nginx vhost directory
file: path=/var/www/html/{{ server_hostname }} state=directory owner={{ php_fpm_pool_user }} group={{ php_fpm_pool_group }} mode=0755 recurse=yes
when: nginx_vhosts|length > 0
notify:
- reload nginx
- name: Remove managed vhost config file (if no vhosts are configured).
file:
path: "{{ nginx_vhost_path }}/{{ nginx_vhosts_filename }}"
state: absent
when: nginx_vhosts|length == 0
notify:
- reload nginx