Fix deprecation warnings
parent
1f82e7adfe
commit
e139ab3e35
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue