Fix deprecation warnings
parent
1f82e7adfe
commit
e139ab3e35
|
@ -4,7 +4,7 @@
|
||||||
file: >
|
file: >
|
||||||
path={{ nginx_htpasswd_dir }}/{{ item.name }}
|
path={{ nginx_htpasswd_dir }}/{{ item.name }}
|
||||||
state=absent
|
state=absent
|
||||||
with_items: nginx_htpasswd
|
with_items: "{{ nginx_htpasswd }}"
|
||||||
when: item.state is defined and item.state == 'absent'
|
when: item.state is defined and item.state == 'absent'
|
||||||
|
|
||||||
- name: HTPASSWD | Manage files
|
- name: HTPASSWD | Manage files
|
||||||
|
@ -14,6 +14,6 @@
|
||||||
state={{ item.1.state | default('present') }}
|
state={{ item.1.state | default('present') }}
|
||||||
path={{ nginx_htpasswd_dir }}/{{ item.0.name }}
|
path={{ nginx_htpasswd_dir }}/{{ item.0.name }}
|
||||||
with_subelements:
|
with_subelements:
|
||||||
- nginx_htpasswd
|
- "{{ nginx_htpasswd }}"
|
||||||
- users
|
- users
|
||||||
when: item.0.state is not defined or item.0.state == 'present'
|
when: item.0.state is not defined or item.0.state == 'present'
|
||||||
|
|
|
@ -18,14 +18,14 @@
|
||||||
file: >
|
file: >
|
||||||
path="{{ nginx_ssl_dir + '/' + item.name }}"
|
path="{{ nginx_ssl_dir + '/' + item.name }}"
|
||||||
state=directory
|
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
|
when: item.dest_key is not defined or item.dest_cert is not defined
|
||||||
|
|
||||||
- name: COPY | Deploy SSL keys
|
- name: COPY | Deploy SSL keys
|
||||||
copy: >
|
copy: >
|
||||||
content="{{ item.key }}"
|
content="{{ item.key }}"
|
||||||
dest="{{ nginx_ssl_dir + '/' + item.name + '/' + item.name + '.key' if item.dest_key is not defined else item.dest_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
|
when: item.key is defined
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
copy: >
|
copy: >
|
||||||
content="{{ item.cert }}"
|
content="{{ item.cert }}"
|
||||||
dest="{{ nginx_ssl_dir + '/' + item.name + '/' + item.name + '.crt' if item.dest_cert is not defined else item.dest_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
|
when: item.cert is defined
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
|
|
||||||
|
|
|
@ -7,5 +7,5 @@
|
||||||
|
|
||||||
- name: TEMPLATE | Deploy other upstreams
|
- name: TEMPLATE | Deploy other upstreams
|
||||||
template: src=etc/nginx/upstream/upstream.conf.j2 dest=/etc/nginx/conf.d/upstream-{{ item.name }}.conf
|
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
|
notify: reload nginx
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
item.proto is defined and
|
item.proto is defined and
|
||||||
'https' in item.proto and
|
'https' in item.proto and
|
||||||
item.ssl_name is not defined
|
item.ssl_name is not defined
|
||||||
with_items: nginx_vhosts
|
with_items: "{{ nginx_vhosts }}"
|
||||||
|
|
||||||
- name: FILE | Create root directory
|
- name: FILE | Create root directory
|
||||||
file: >
|
file: >
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
owner={{ item.owner | default('www-data') }}
|
owner={{ item.owner | default('www-data') }}
|
||||||
group={{ item.group | default('www-data') }}
|
group={{ item.group | default('www-data') }}
|
||||||
mode={{ item.mode | default('0755') }}
|
mode={{ item.mode | default('0755') }}
|
||||||
with_items: nginx_vhosts
|
with_items: "{{ nginx_vhosts }}"
|
||||||
when: >
|
when: >
|
||||||
item.root is not defined and
|
item.root is not defined and
|
||||||
(item.template is defined and item.template not in nginx_templates_no_dir) and
|
(item.template is defined and item.template not in nginx_templates_no_dir) and
|
||||||
|
@ -31,13 +31,13 @@
|
||||||
template: >
|
template: >
|
||||||
src=etc/nginx/sites-available/{{ item.template if item.redirect_to is not defined else '_redirect' }}.j2
|
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] }}
|
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
|
notify: reload nginx
|
||||||
when: item.delete is not defined or not item.delete
|
when: item.delete is not defined or not item.delete
|
||||||
|
|
||||||
- name: FILE | Delete vhosts
|
- name: FILE | Delete vhosts
|
||||||
file: path=/etc/nginx/sites-available/{{ item.name if item.name is string else item.name[0] }} state=absent
|
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
|
notify: reload nginx
|
||||||
when: item.delete is defined and item.delete
|
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] }}
|
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] }}
|
dest=/etc/nginx/sites-enabled/{{ item.name if item.name is string else item.name[0] }}
|
||||||
state=link
|
state=link
|
||||||
with_items: nginx_vhosts
|
with_items: "{{ nginx_vhosts }}"
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
when: >
|
when: >
|
||||||
((item.enable is not defined) or
|
((item.enable is not defined) or
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
- name: FILE | Disable vhosts
|
- name: FILE | Disable vhosts
|
||||||
file: path=/etc/nginx/sites-enabled/{{ item.name if item.name is string else item.name[0] }} state=absent
|
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
|
notify: reload nginx
|
||||||
when: (item.enable is defined and not item.enable) or (item.delete is defined and item.delete)
|
when: (item.enable is defined and not item.enable) or (item.delete is defined and item.delete)
|
||||||
|
|
||||||
|
|
|
@ -214,7 +214,7 @@
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
- name: -- VERIFY VHOSTS --
|
- 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 %}/"
|
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
|
when: item.delete is undefined or not item.delete
|
||||||
changed_when: false
|
changed_when: false
|
||||||
- name: -- VERIFY FORBIDDEN --
|
- name: -- VERIFY FORBIDDEN --
|
||||||
|
@ -224,7 +224,7 @@
|
||||||
changed_when: false
|
changed_when: false
|
||||||
- name: -- VERIFY REDIRECT VHOSTS --
|
- name: -- VERIFY REDIRECT VHOSTS --
|
||||||
command: "curl -H 'Host: {{ item.redirect_from[0] }}' http://127.0.0.1/"
|
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)
|
when: item.redirect_from is defined and (item.delete is undefined or not item.delete)
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: r
|
register: r
|
||||||
|
|
Loading…
Reference in New Issue