Commit 5a142454 authored by Jocelyn Delalande's avatar Jocelyn Delalande

nginx: add a "nick" option to vhosts

To allow domains with a regex in the name.
parent 18a884a3
......@@ -16,14 +16,14 @@
- name: Install vhosts settings
template:
src: vhost.j2
dest: "/etc/nginx/sites-available/{{ item.domain }}-{{ item.type }}"
dest: "/etc/nginx/sites-available/{{ item.nick|default(item.domain) }}-{{ item.type }}"
with_items: '{{ nginx_vhosts }}'
notify: Restart nginx
- name: Enable vhosts
file:
src: "/etc/nginx/sites-available/{{ item.domain }}-{{ item.type }}"
dest: "/etc/nginx/sites-enabled/{{ item.domain }}-{{ item.type }}"
src: "/etc/nginx/sites-available/{{ item.nick|default(item.domain) }}-{{ item.type }}"
dest: "/etc/nginx/sites-enabled/{{ item.nick|default(item.domain) }}-{{ item.type }}"
state: link
with_items: '{{ nginx_vhosts }}'
notify: Restart nginx
......
......@@ -14,9 +14,9 @@ server {
ssl_certificate_key /etc/letsencrypt/live/{{ item.domain }}/privkey.pem;
{% endif %}
access_log /var/log/{{ item.domain }}-{{ item.type }}.access.log;
access_log /var/log/nginx/{{ item.nick|default(item.domain) }}-{{ item.type }}.access.log;
{% if ansible_lsb.codename != "wheezy" %}
error_log /var/log/{{ item.domain }}-{{ item.type }}.error.log;
error_log /var/log/nginx/{{ item.nick|default(item.domain) }}-{{ item.type }}.error.log;
{% endif %}
{% if item.features is defined %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment