From e139ab3e3514d6be40578ef2e683153401530c2a Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Sat, 5 Mar 2016 11:37:37 +0100 Subject: [PATCH] Fix deprecation warnings --- tasks/htpasswd.yml | 4 ++-- tasks/ssl.yml | 6 +++--- tasks/upstream.yml | 2 +- tasks/vhost.yml | 12 ++++++------ tests/test.yml | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tasks/htpasswd.yml b/tasks/htpasswd.yml index 27432a2..a44fcda 100644 --- a/tasks/htpasswd.yml +++ b/tasks/htpasswd.yml @@ -4,7 +4,7 @@ file: > path={{ nginx_htpasswd_dir }}/{{ item.name }} state=absent - with_items: nginx_htpasswd + with_items: "{{ nginx_htpasswd }}" when: item.state is defined and item.state == 'absent' - name: HTPASSWD | Manage files @@ -14,6 +14,6 @@ state={{ item.1.state | default('present') }} path={{ nginx_htpasswd_dir }}/{{ item.0.name }} with_subelements: - - nginx_htpasswd + - "{{ nginx_htpasswd }}" - users when: item.0.state is not defined or item.0.state == 'present' diff --git a/tasks/ssl.yml b/tasks/ssl.yml index cf409c8..e489f0e 100644 --- a/tasks/ssl.yml +++ b/tasks/ssl.yml @@ -18,14 +18,14 @@ file: > path="{{ nginx_ssl_dir + '/' + item.name }}" state=directory - with_items: nginx_ssl_pairs + with_items: "{{ nginx_ssl_pairs }}" when: item.dest_key is not defined or item.dest_cert is not defined - name: COPY | Deploy SSL keys copy: > content="{{ item.key }}" dest="{{ nginx_ssl_dir + '/' + item.name + '/' + item.name + '.key' if item.dest_key is not defined else item.dest_key }}" - with_items: nginx_ssl_pairs + with_items: "{{ nginx_ssl_pairs }}" when: item.key is defined notify: reload nginx @@ -33,7 +33,7 @@ copy: > content="{{ item.cert }}" dest="{{ nginx_ssl_dir + '/' + item.name + '/' + item.name + '.crt' if item.dest_cert is not defined else item.dest_cert }}" - with_items: nginx_ssl_pairs + with_items: "{{ nginx_ssl_pairs }}" when: item.cert is defined notify: reload nginx diff --git a/tasks/upstream.yml b/tasks/upstream.yml index 750703f..cda9765 100644 --- a/tasks/upstream.yml +++ b/tasks/upstream.yml @@ -7,5 +7,5 @@ - name: TEMPLATE | Deploy other upstreams template: src=etc/nginx/upstream/upstream.conf.j2 dest=/etc/nginx/conf.d/upstream-{{ item.name }}.conf - with_items: nginx_upstreams + with_items: "{{ nginx_upstreams }}" notify: reload nginx diff --git a/tasks/vhost.yml b/tasks/vhost.yml index 9ec8d00..e20d82b 100644 --- a/tasks/vhost.yml +++ b/tasks/vhost.yml @@ -6,7 +6,7 @@ item.proto is defined and 'https' in item.proto and item.ssl_name is not defined - with_items: nginx_vhosts + with_items: "{{ nginx_vhosts }}" - name: FILE | Create root directory file: > @@ -20,7 +20,7 @@ owner={{ item.owner | default('www-data') }} group={{ item.group | default('www-data') }} mode={{ item.mode | default('0755') }} - with_items: nginx_vhosts + with_items: "{{ nginx_vhosts }}" when: > item.root is not defined and (item.template is defined and item.template not in nginx_templates_no_dir) and @@ -31,13 +31,13 @@ template: > src=etc/nginx/sites-available/{{ item.template if item.redirect_to is not defined else '_redirect' }}.j2 dest=/etc/nginx/sites-available/{{ item.name if item.name is string else item.name[0] }} - with_items: nginx_vhosts + with_items: "{{ nginx_vhosts }}" notify: reload nginx when: item.delete is not defined or not item.delete - name: FILE | Delete vhosts file: path=/etc/nginx/sites-available/{{ item.name if item.name is string else item.name[0] }} state=absent - with_items: nginx_vhosts + with_items: "{{ nginx_vhosts }}" notify: reload nginx when: item.delete is defined and item.delete @@ -46,7 +46,7 @@ src=/etc/nginx/sites-available/{{ item.name if item.name is string else item.name[0] }} dest=/etc/nginx/sites-enabled/{{ item.name if item.name is string else item.name[0] }} state=link - with_items: nginx_vhosts + with_items: "{{ nginx_vhosts }}" notify: reload nginx when: > ((item.enable is not defined) or @@ -55,7 +55,7 @@ - name: FILE | Disable vhosts file: path=/etc/nginx/sites-enabled/{{ item.name if item.name is string else item.name[0] }} state=absent - with_items: nginx_vhosts + with_items: "{{ nginx_vhosts }}" notify: reload nginx when: (item.enable is defined and not item.enable) or (item.delete is defined and item.delete) diff --git a/tests/test.yml b/tests/test.yml index 2bcfba7..a3a98c0 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -214,7 +214,7 @@ # -------------------------------- - name: -- VERIFY VHOSTS -- command: "curl -H 'Host: {{ item.name if item.name is string else item.name[0] }}' http://127.0.0.1{% if item.listen is defined %}:{{ item.listen[0] }}{% endif %}/" - with_items: nginx_vhosts + with_items: "{{ nginx_vhosts }}" when: item.delete is undefined or not item.delete changed_when: false - name: -- VERIFY FORBIDDEN -- @@ -224,7 +224,7 @@ changed_when: false - name: -- VERIFY REDIRECT VHOSTS -- command: "curl -H 'Host: {{ item.redirect_from[0] }}' http://127.0.0.1/" - with_items: nginx_vhosts + with_items: "{{ nginx_vhosts }}" when: item.redirect_from is defined and (item.delete is undefined or not item.delete) changed_when: false register: r