vhost.filename used by log and directories creation

pull/27/head
Emilien Mantel 2016-10-07 10:50:05 +02:00
parent 8789bd2c9c
commit c4ee6eb1a2
3 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,7 @@
- name: FILE | Create root public folders (foreach nginx_vhosts)
file: >
path={{ nginx_root }}/{{ item.name if item.name is string else item.name[0] }}/public
path={{ nginx_root }}/{{ item.filename | default(item.name if item.name is string else item.name[0]) }}/public
state=directory
owner={{ item.owner | default(nginx_user) }}
group={{ item.group | default(nginx_user) }}

View File

@ -1,5 +1,5 @@
{% set __proto = item.proto | default(['http']) %}
{% set __main_name = item.name if item.name is string else item.name[0] %}
{% set __main_name = item.filename | default(item.name if item.name is string else item.name[0]) %}
{% set __listen = item.listen | default(['80']) %}
{% set __listen_ssl = item.listen_ssl | default(['443']) %}
{% set __location = item.location | default({}) %}

View File

@ -106,7 +106,7 @@
-----END CERTIFICATE-----
nginx_custom_http:
- 'add_header X-ansible 1;'
nginx_default_vhost: 'test.local'
nginx_default_vhost: 'first-test'
nginx_default_vhost_ssl: 'test-ssl-predeployed.local'
nginx_vhosts:
- name:
@ -120,7 +120,7 @@
'X-Frame-Options': 'deny always'
'X-ansible-default': '1'
manage_local_content: false
use_error_log: false
use_error_log: true
more:
- 'autoindex off;'
location:
@ -209,7 +209,7 @@
with_items: ['test-php.local', 'test-php-index.local']
- name: -- Add HTML file --
copy: dest="{{ item }}/index.html" content="Index HTML test OK\n"
with_items: ['{{ nginx_root }}/test.local/public', '/var/tmp', '{{ nginx_root }}/test-htpasswd-all.local/public', '{{ nginx_root }}/test-ssl.local/public', '{{ nginx_root }}/test-ssl-predeployed.local/public']
with_items: ['{{ nginx_root }}/first-test/public', '/var/tmp', '{{ nginx_root }}/test-htpasswd-all.local/public', '{{ nginx_root }}/test-ssl.local/public', '{{ nginx_root }}/test-ssl-predeployed.local/public']
- name: -- Create directory --
file: path={{ nginx_root }}/test-htpasswd.local/public/hello state=directory
- name: -- Add HTML file hello --