From 7b47c3de1243d3868b9eea780d6ae4687753f56f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Sch=C3=B6ldstr=C3=B6m?= Date: Sat, 3 Jun 2017 09:01:09 -0500 Subject: [PATCH] vhost_filename -> filename --- README.md | 6 +++--- defaults/main.yml | 2 +- tasks/vhosts.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1103c8c..5a5f668 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ A list of vhost definitions (server blocks) for Nginx virtual hosts. Each entry error_log: "" state: "present" template: "{{ nginx_vhost_template }}" - vhost_filename: "example.com.conf" + filename: "example.com.conf" extra_parameters: | location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; @@ -50,11 +50,11 @@ Please take note of the indentation in the above block. The first line should be - listen: "80" server_name: "example.com www.example.com" return "301 https://example.com$request_uri;" - vhost_filename: "example.com.80.conf" + filename: "example.com.80.conf" An example of a secondary vhost which will redirect to the one shown above. -*Note: The `vhost_filename` defaults to the first domain in `server_name`, if you have two vhosts with the same domain, eg. a redirect, you need to manually set the `vhost_filename` so the second one doesn't override the first one* +*Note: The `filename` defaults to the first domain in `server_name`, if you have two vhosts with the same domain, eg. a redirect, you need to manually set the `filename` so the second one doesn't override the first one* nginx_remove_default_vhost: false diff --git a/defaults/main.yml b/defaults/main.yml index fff97c9..b21140b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -59,7 +59,7 @@ nginx_vhosts: [] # server_name: "example.com" # default: N/A # root: "/var/www/example.com" # default: N/A # index: "index.html index.htm" # default: "index.html index.htm" -# vhost_filename: "example.com.conf" # Can be used to set the filename of the vhost file. +# filename: "example.com.conf" # Can be used to set the filename of the vhost file. # # # Properties that are only added if defined: # server_name_redirect: "www.example.com" # default: N/A diff --git a/tasks/vhosts.yml b/tasks/vhosts.yml index e7bd642..05af037 100644 --- a/tasks/vhosts.yml +++ b/tasks/vhosts.yml @@ -15,7 +15,7 @@ - name: Add managed vhost config files. template: src: "{{ item.template|default(nginx_vhost_template) }}" - dest: "{{ nginx_vhost_path }}/{{ item.vhost_filename|default(item.server_name.split(' ')[0] ~ '.conf') }}" + dest: "{{ nginx_vhost_path }}/{{ item.filename|default(item.server_name.split(' ')[0] ~ '.conf') }}" force: yes owner: root group: root @@ -26,7 +26,7 @@ - name: Remove managed vhost config files. file: - path: "{{ nginx_vhost_path }}/{{ item.vhost_filename|default(item.server_name.split(' ')[0] ~ '.conf') }}" + path: "{{ nginx_vhost_path }}/{{ item.filename|default(item.server_name.split(' ')[0] ~ '.conf') }}" state: absent when: item.state|default('present') == 'absent' with_items: "{{ nginx_vhosts }}"