Rename nginx_* variables underneath nginx_vhosts

It's just deduplication, since it's already obvious that the dict
is for nginx-related vars:

    - nginx_domain_name→domain_name
    - nginx_domain_aliases→domain_aliases
    - nginx_enable_https→enable_https
    - nginx_enable_hsts→enable_hsts

Signed-off-by: Alan Orth <alan.orth@gmail.com>
This commit is contained in:
2015-12-10 00:25:44 +02:00
parent 41547defb9
commit 940b2720da
6 changed files with 89 additions and 91 deletions

View File

@ -1,7 +1,7 @@
---
- name: Configure https vhosts
template: src=vhost.conf.j2 dest={{ nginx_confd_path }}/{{ item.nginx_domain_name }}.conf mode=0644 owner=root group=root
template: src=vhost.conf.j2 dest={{ nginx_confd_path }}/{{ item.domain_name }}.conf mode=0644 owner=root group=root
with_items: nginx_vhosts
notify:
- reload nginx
@ -17,17 +17,17 @@
- reload nginx
- name: Create vhost document roots
file: path={{ nginx_root_prefix }}/{{ item.nginx_domain_name }} state=directory mode=0755 owner=nginx group=nginx
file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory mode=0755 owner=nginx group=nginx
with_items: nginx_vhosts
- name: Install WordPress
git: repo=https://github.com/WordPress/WordPress.git dest={{ nginx_root_prefix }}/{{ item.nginx_domain_name }}/wordpress version={{ item.wordpress_version }} depth=1
git: repo=https://github.com/WordPress/WordPress.git dest={{ nginx_root_prefix }}/{{ item.domain_name }}/wordpress version={{ item.wordpress_version }} depth=1
when: item.has_wordpress == 'yes'
with_items: nginx_vhosts
tags: wordpress
- name: Fix WordPress directory permissions
file: path={{ nginx_root_prefix }}/{{ item.nginx_domain_name }} state=directory owner=nginx group=nginx recurse=yes
file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory owner=nginx group=nginx recurse=yes
when: item.has_wordpress == 'yes'
with_items: nginx_vhosts
tags: wordpress

View File

@ -1,7 +1,7 @@
{# helper variables and per-site defaults that we can't set in role defaults #}
{% set domain_name = item.nginx_domain_name %}
{% set domain_name = item.domain_name %}
{# assume HSTS is off unless a vhost explicitly sets it to "yes" #}
{% set enable_hsts = item.nginx_enable_hsts | default("no") %}
{% set enable_hsts = item.enable_hsts | default("no") %}
{# use self-signed certs? yes on development, no on production #}
{% set use_snakeoil_cert = item.use_snakeoil_cert | default("no") %}

View File

@ -1,9 +1,9 @@
{# helper variables and per-site defaults that we can't set in role defaults #}
{% set domain_name = item.nginx_domain_name %}
{% set domain_aliases = item.nginx_domain_aliases | default("") %}
{% set enable_https = item.nginx_enable_https | default("no") %}
{% set domain_name = item.domain_name %}
{% set domain_aliases = item.domain_aliases | default("") %}
{% set enable_https = item.enable_https | default("no") %}
{# assume HSTS is off unless a vhost explicitly sets it to "yes" #}
{% set enable_hsts = item.nginx_enable_hsts | default("no") %}
{% set enable_hsts = item.enable_hsts | default("no") %}
{% set has_wordpress = item.has_wordpress | default("no") %}
{% if enable_https == "yes" %}