Fix deprecations on Ansible 2.7
- with_ -> loop - fix filters as test - test version_compare -> version - set min_version to 2.5pull/35/head
parent
d168219c29
commit
682339d818
13
.travis.yml
13
.travis.yml
|
@ -1,17 +1,4 @@
|
||||||
env:
|
env:
|
||||||
- PLATFORM='docker-debian-jessie' ANSIBLE_VERSION='ansible>=2.2,<2.3'
|
|
||||||
- PLATFORM='docker-debian-jessie-backports' ANSIBLE_VERSION='ansible>=2.2,<2.3'
|
|
||||||
- PLATFORM='docker-debian-jessie-dotdeb' ANSIBLE_VERSION='ansible>=2.2,<2.3'
|
|
||||||
- PLATFORM='docker-debian-jessie' ANSIBLE_VERSION='ansible>=2.3,<2.4'
|
|
||||||
- PLATFORM='docker-debian-jessie-backports' ANSIBLE_VERSION='ansible>=2.3,<2.4'
|
|
||||||
- PLATFORM='docker-debian-jessie-dotdeb' ANSIBLE_VERSION='ansible>=2.3,<2.4'
|
|
||||||
- PLATFORM='docker-debian-stretch' ANSIBLE_VERSION='ansible>=2.3,<2.4'
|
|
||||||
- PLATFORM='docker-debian-stretch-sury' ANSIBLE_VERSION='ansible>=2.3,<2.4'
|
|
||||||
- PLATFORM='docker-debian-jessie' ANSIBLE_VERSION='ansible>=2.4,<2.5'
|
|
||||||
- PLATFORM='docker-debian-jessie-backports' ANSIBLE_VERSION='ansible>=2.4,<2.5'
|
|
||||||
- PLATFORM='docker-debian-jessie-dotdeb' ANSIBLE_VERSION='ansible>=2.4,<2.5'
|
|
||||||
- PLATFORM='docker-debian-stretch' ANSIBLE_VERSION='ansible>=2.4,<2.5'
|
|
||||||
- PLATFORM='docker-debian-stretch-sury' ANSIBLE_VERSION='ansible>=2.4,<2.5'
|
|
||||||
- PLATFORM='docker-debian-jessie' ANSIBLE_VERSION='ansible>=2.5,<2.6'
|
- PLATFORM='docker-debian-jessie' ANSIBLE_VERSION='ansible>=2.5,<2.6'
|
||||||
- PLATFORM='docker-debian-jessie-backports' ANSIBLE_VERSION='ansible>=2.5,<2.6'
|
- PLATFORM='docker-debian-jessie-backports' ANSIBLE_VERSION='ansible>=2.5,<2.6'
|
||||||
- PLATFORM='docker-debian-jessie-dotdeb' ANSIBLE_VERSION='ansible>=2.5,<2.6'
|
- PLATFORM='docker-debian-jessie-dotdeb' ANSIBLE_VERSION='ansible>=2.5,<2.6'
|
||||||
|
|
|
@ -30,7 +30,7 @@ Supported OS:
|
||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
None. If you set true to `nginx_backports`, you must install backports repository before lauching this role.
|
Ansible 2.5+. If you set true to `nginx_backports`, you must install backports repository before lauching this role.
|
||||||
|
|
||||||
Role Variables
|
Role Variables
|
||||||
--------------
|
--------------
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
---
|
---
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
author: Emilien Mantel
|
author: Emilien Mantel
|
||||||
description: Nginx for Debian
|
description: Nginx for Debian / FreeBSD
|
||||||
company:
|
company:
|
||||||
license: GPLv2
|
license: GPLv2
|
||||||
min_ansible_version: 2.2
|
min_ansible_version: 2.5
|
||||||
platforms:
|
platforms:
|
||||||
- name: Debian
|
- name: Debian
|
||||||
versions:
|
versions:
|
||||||
- jessie
|
- jessie
|
||||||
|
- stretch
|
||||||
- name: FreeBSD
|
- name: FreeBSD
|
||||||
versions:
|
versions:
|
||||||
- 11.0
|
- 11.0
|
||||||
|
|
|
@ -24,13 +24,14 @@
|
||||||
regexp: '{{ item.0.regexp }}'
|
regexp: '{{ item.0.regexp }}'
|
||||||
line: '{{ item.0.line }}'
|
line: '{{ item.0.line }}'
|
||||||
dest: '{{ item.1 }}'
|
dest: '{{ item.1 }}'
|
||||||
with_nested:
|
loop: "{{ list_one | product(list_two) | list }}"
|
||||||
-
|
vars:
|
||||||
|
list_one:
|
||||||
- regexp: '^fastcgi_param SCRIPT_FILENAME'
|
- regexp: '^fastcgi_param SCRIPT_FILENAME'
|
||||||
line: 'fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;'
|
line: 'fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;'
|
||||||
- regexp: '^fastcgi_param DOCUMENT_ROOT'
|
- regexp: '^fastcgi_param DOCUMENT_ROOT'
|
||||||
line: 'fastcgi_param DOCUMENT_ROOT $realpath_root;'
|
line: 'fastcgi_param DOCUMENT_ROOT $realpath_root;'
|
||||||
-
|
list_two:
|
||||||
- '{{ nginx_etc_dir }}/fastcgi.conf'
|
- '{{ nginx_etc_dir }}/fastcgi.conf'
|
||||||
when: nginx_fastcgi_fix_realpath
|
when: nginx_fastcgi_fix_realpath
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,5 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: FAIL | Check possible issues
|
|
||||||
fail:
|
|
||||||
msg: "This ansible version ({{ ansible_version.full}}) is not compatible with your needs (Debian Stretch + htpasswd). Please see https://github.com/HanXHX/ansible-nginx/issues/28"
|
|
||||||
when:
|
|
||||||
ansible_distribution_major_version | version_compare('9', 'ge') and
|
|
||||||
ansible_version.full | version_compare('2.3.2', 'lt') and
|
|
||||||
nginx_htpasswd | length > 0
|
|
||||||
|
|
||||||
- name: APT | Update cache
|
- name: APT | Update cache
|
||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
@ -29,11 +21,10 @@
|
||||||
|
|
||||||
- name: APT | Install nginx modules
|
- name: APT | Install nginx modules
|
||||||
apt:
|
apt:
|
||||||
pkg: "{{ item }}"
|
pkg: "{{ nginx_module_packages }}"
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ nginx_module_packages }}"
|
|
||||||
when:
|
when:
|
||||||
ansible_distribution_major_version | version_compare('9', 'ge') or
|
ansible_distribution_major_version is version('9', 'ge') or
|
||||||
nginx_backports
|
nginx_backports
|
||||||
|
|
||||||
- name: APT | Install python-passlib
|
- name: APT | Install python-passlib
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
owner: "{{ item.owner | default(nginx_user) }}"
|
owner: "{{ item.owner | default(nginx_user) }}"
|
||||||
group: "{{ item.group | default(nginx_user) }}"
|
group: "{{ item.group | default(nginx_user) }}"
|
||||||
mode: "{{ item.mode | default('0755') }}"
|
mode: "{{ item.mode | default('0755') }}"
|
||||||
with_items: "{{ nginx_sites }}"
|
loop: "{{ nginx_sites }}"
|
||||||
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
|
||||||
|
@ -43,9 +43,9 @@
|
||||||
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: "{{ nginx_etc_dir }}/sites-available/{{ item | nginx_site_filename }}"
|
dest: "{{ nginx_etc_dir }}/sites-available/{{ item | nginx_site_filename }}"
|
||||||
with_items: "{{ nginx_sites }}"
|
|
||||||
notify: ['reload nginx', 'restart nginx freebsd']
|
notify: ['reload nginx', 'restart nginx freebsd']
|
||||||
when: item.state is not defined or item.state != 'absent'
|
when: item.state is not defined or item.state != 'absent'
|
||||||
|
loop: "{{ nginx_sites }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item | nginx_site_name }}"
|
label: "{{ item | nginx_site_name }}"
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
template:
|
template:
|
||||||
src: "etc/nginx/conf.d/_upstream.conf.j2"
|
src: "etc/nginx/conf.d/_upstream.conf.j2"
|
||||||
dest: "{{ nginx_etc_dir }}/conf.d/upstream-{{ item.name }}.conf"
|
dest: "{{ nginx_etc_dir }}/conf.d/upstream-{{ item.name }}.conf"
|
||||||
with_items: "{{ nginx_upstreams }}"
|
loop: "{{ nginx_upstreams }}"
|
||||||
when: item.state is not defined or item.state == 'present'
|
when: item.state is not defined or item.state == 'present'
|
||||||
notify: reload nginx
|
notify: reload nginx
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{%- macro s(key, value, is_bool, min_version) %}
|
{%- macro s(key, value, is_bool, min_version) %}
|
||||||
{% if nginx_version.stdout | version_compare(min_version, 'ge') %}
|
{% if nginx_version.stdout is version(min_version, 'ge') %}
|
||||||
{% if is_bool and value %} {{ key }}{% elif not is_bool %} {{ key }}={{ value }}{% endif %}
|
{% if is_bool and value %} {{ key }}{% elif not is_bool %} {{ key }}={{ value }}{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- endmacro -%}
|
{%- endmacro -%}
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
|
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
|
||||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2{% if nginx_version.stdout | version_compare('1.13.0', 'ge') %} TLSv1.3{% endif %};
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2{% if nginx_version.stdout is version('1.13.0', 'ge') %} TLSv1.3{% endif %};
|
||||||
ssl_prefer_server_ciphers on;
|
ssl_prefer_server_ciphers on;
|
||||||
ssl_session_cache shared:SSL:10m;
|
ssl_session_cache shared:SSL:10m;
|
||||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"{% if nginx_version.stdout | version_compare('1.7.5', 'ge') %} always{% endif %};
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"{% if nginx_version.stdout is version('1.7.5', 'ge') %} always{% endif %};
|
||||||
ssl_stapling on;
|
ssl_stapling on;
|
||||||
ssl_stapling_verify on;
|
ssl_stapling_verify on;
|
||||||
resolver {{ nginx_resolver_hosts | join(' ') }} valid={{ nginx_resolver_valid }};
|
resolver {{ nginx_resolver_hosts | join(' ') }} valid={{ nginx_resolver_valid }};
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
|
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
|
||||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2{% if nginx_version.stdout | version_compare('1.13.0', 'ge') %} TLSv1.3{% endif %};
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2{% if nginx_version.stdout is version('1.13.0', 'ge') %} TLSv1.3{% endif %};
|
||||||
ssl_prefer_server_ciphers on;
|
ssl_prefer_server_ciphers on;
|
||||||
ssl_session_cache shared:SSL:10m;
|
ssl_session_cache shared:SSL:10m;
|
||||||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"{% if nginx_version.stdout | version_compare('1.7.5', 'ge') %} always{% endif %};
|
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains"{% if nginx_version.stdout is version('1.7.5', 'ge') %} always{% endif %};
|
||||||
ssl_stapling on;
|
ssl_stapling on;
|
||||||
ssl_stapling_verify on;
|
ssl_stapling_verify on;
|
||||||
resolver {{ nginx_resolver_hosts | join(' ') }} valid={{ nginx_resolver_valid }};
|
resolver {{ nginx_resolver_hosts | join(' ') }} valid={{ nginx_resolver_valid }};
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
user {{ nginx_user }};
|
user {{ nginx_user }};
|
||||||
worker_processes {{ nginx_worker_processes }};
|
worker_processes {{ nginx_worker_processes }};
|
||||||
pid {{ nginx_pid }};
|
pid {{ nginx_pid }};
|
||||||
{% if nginx_version.stdout | version_compare('1.9.11', 'ge') %}
|
{% if nginx_version.stdout is version('1.9.11', 'ge') %}
|
||||||
include {{ nginx_etc_dir }}/modules-enabled/*.conf;
|
include {{ nginx_etc_dir }}/modules-enabled/*.conf;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ server {
|
||||||
{% block template_headers %}
|
{% block template_headers %}
|
||||||
# --> Custom headers
|
# --> Custom headers
|
||||||
{% for key, value in __headers.iteritems() %}
|
{% for key, value in __headers.iteritems() %}
|
||||||
add_header {{ key }} "{{ value | replace(' always', '') }}"{% if nginx_version.stdout | version_compare('1.7.5', 'ge') and ' always' in value %} always{% endif %};
|
add_header {{ key }} "{{ value | replace(' always', '') }}"{% if nginx_version.stdout is version('1.7.5', 'ge') and ' always' in value %} always{% endif %};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
# <-- Custom headers
|
# <-- Custom headers
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -2,11 +2,12 @@
|
||||||
|
|
||||||
- name: APT | Install webapps
|
- name: APT | Install webapps
|
||||||
apt:
|
apt:
|
||||||
pkg: "{{ item }}"
|
pkg: "{{ packages }}"
|
||||||
state: present
|
state: present
|
||||||
install_recommends: no
|
install_recommends: no
|
||||||
with_items:
|
vars:
|
||||||
- backuppc
|
packages:
|
||||||
|
- backuppc
|
||||||
|
|
||||||
- name: SERVICE | Ensure backuppc is started
|
- name: SERVICE | Ensure backuppc is started
|
||||||
service:
|
service:
|
||||||
|
|
|
@ -45,19 +45,20 @@
|
||||||
|
|
||||||
- name: APT | Install needed packages
|
- name: APT | Install needed packages
|
||||||
apt:
|
apt:
|
||||||
pkg: "{{ item }}"
|
pkg: "{{ packages }}"
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
cache_valid_time: 3600
|
cache_valid_time: 3600
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
vars:
|
||||||
- cron
|
packages:
|
||||||
- curl
|
- cron
|
||||||
- fcgiwrap
|
- curl
|
||||||
- jq
|
- fcgiwrap
|
||||||
- nghttp2
|
- jq
|
||||||
- strace
|
- nghttp2
|
||||||
- vim
|
- strace
|
||||||
- unzip
|
- vim
|
||||||
|
- unzip
|
||||||
|
|
||||||
- name: APT | Install daemonize from Stretch
|
- name: APT | Install daemonize from Stretch
|
||||||
apt:
|
apt:
|
||||||
|
@ -69,7 +70,7 @@
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
cache_valid_time: 3600
|
cache_valid_time: 3600
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ nginx_php }}"
|
loop: "{{ nginx_php }}"
|
||||||
register: apt_php
|
register: apt_php
|
||||||
|
|
||||||
- name: SERVICE | Force start fcgiwrap
|
- name: SERVICE | Force start fcgiwrap
|
||||||
|
@ -77,10 +78,11 @@
|
||||||
name: "fcgiwrap"
|
name: "fcgiwrap"
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
# Bypasses Ansible 2.4 issue (cannot use service module)... With service module... php is not really started!
|
|
||||||
- name: COMMAND | Force start PHP
|
- name: COMMAND | Force start PHP
|
||||||
command: "service {{ item.version | php_fpm_service }} start"
|
service:
|
||||||
with_items: "{{ nginx_php }}"
|
name: "{{ item.version | php_fpm_service }}"
|
||||||
|
state: started
|
||||||
|
loop: "{{ nginx_php }}"
|
||||||
when: apt_php.changed
|
when: apt_php.changed
|
||||||
|
|
||||||
- name: GET_URL | Download ngrok
|
- name: GET_URL | Download ngrok
|
||||||
|
|
|
@ -15,17 +15,18 @@
|
||||||
|
|
||||||
- name: PKGNG | Install needed packages
|
- name: PKGNG | Install needed packages
|
||||||
pkgng:
|
pkgng:
|
||||||
pkg: "{{ item }}"
|
pkg: "{{ packages }}"
|
||||||
state: present
|
state: present
|
||||||
with_items:
|
vars:
|
||||||
- curl
|
packages:
|
||||||
- daemonize
|
- curl
|
||||||
- fcgiwrap
|
- daemonize
|
||||||
- GeoIP
|
- fcgiwrap
|
||||||
- jq
|
- GeoIP
|
||||||
- nghttp2
|
- jq
|
||||||
- php72
|
- nghttp2
|
||||||
- vim
|
- php72
|
||||||
|
- vim
|
||||||
|
|
||||||
- name: COMMAND | Get geoip database
|
- name: COMMAND | Get geoip database
|
||||||
command: geoipupdate.sh
|
command: geoipupdate.sh
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
register: sf
|
register: sf
|
||||||
with_items:
|
loop:
|
||||||
- php-fpm
|
- php-fpm
|
||||||
- fcgiwrap
|
- fcgiwrap
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
- name: SHELL | Get ngrok public address
|
- name: SHELL | Get ngrok public address
|
||||||
shell: curl 'http://127.0.0.1:4040/api/tunnels/command_line' | jq '.public_url' | grep -oE '[[:alnum:]]+\.ngrok\.io'
|
shell: curl 'http://127.0.0.1:4040/api/tunnels/command_line' | jq '.public_url' | grep -oE '[[:alnum:]]+\.ngrok\.io'
|
||||||
|
args:
|
||||||
|
warn: false
|
||||||
register: ngrok
|
register: ngrok
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
@ -22,6 +24,6 @@
|
||||||
line: "set mouse="
|
line: "set mouse="
|
||||||
dest: "{{ item }}/.vimrc"
|
dest: "{{ item }}/.vimrc"
|
||||||
create: yes
|
create: yes
|
||||||
with_items:
|
loop:
|
||||||
- /root
|
- /root
|
||||||
- /home/vagrant
|
- /home/vagrant
|
||||||
|
|
|
@ -276,7 +276,7 @@
|
||||||
copy:
|
copy:
|
||||||
dest: "{{ nginx_root }}/{{ item }}/public/index.php"
|
dest: "{{ nginx_root }}/{{ item }}/public/index.php"
|
||||||
content: "<?php phpinfo();"
|
content: "<?php phpinfo();"
|
||||||
with_items:
|
loop:
|
||||||
- 'test-php.local'
|
- 'test-php.local'
|
||||||
- 'test-php-index.local'
|
- 'test-php-index.local'
|
||||||
- 'test-php-index2.local'
|
- 'test-php-index2.local'
|
||||||
|
@ -285,7 +285,7 @@
|
||||||
copy:
|
copy:
|
||||||
dest: "{{ item }}/index.html"
|
dest: "{{ item }}/index.html"
|
||||||
content: "Index HTML test OK\n"
|
content: "Index HTML test OK\n"
|
||||||
with_items:
|
loop:
|
||||||
- '{{ nginx_root }}/first-test/public'
|
- '{{ nginx_root }}/first-test/public'
|
||||||
- '/var/tmp'
|
- '/var/tmp'
|
||||||
- '{{ nginx_root }}/test-htpasswd-all.local/public'
|
- '{{ nginx_root }}/test-htpasswd-all.local/public'
|
||||||
|
@ -319,7 +319,7 @@
|
||||||
url: "http://{{ item | nginx_site_name }}{% if item.listen is defined %}:{{ item.listen[0] }}{% endif %}/"
|
url: "http://{{ item | nginx_site_name }}{% if item.listen is defined %}:{{ item.listen[0] }}{% endif %}/"
|
||||||
status_code: '200,301,302,401,403'
|
status_code: '200,301,302,401,403'
|
||||||
follow_redirects: none
|
follow_redirects: none
|
||||||
with_items: "{{ nginx_sites }}"
|
loop: "{{ nginx_sites }}"
|
||||||
when: item.state is undefined or item.state != "absent"
|
when: item.state is undefined or item.state != "absent"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@
|
||||||
url: "http://{{ item.redirect_from[0] }}/"
|
url: "http://{{ item.redirect_from[0] }}/"
|
||||||
status_code: 301
|
status_code: 301
|
||||||
follow_redirects: none
|
follow_redirects: none
|
||||||
with_items: "{{ nginx_sites }}"
|
loop: "{{ nginx_sites }}"
|
||||||
when: item.redirect_from is defined and (item.state is undefined or item.state != "absent") and (item.proto is not defined or 'https' not in item.proto)
|
when: item.redirect_from is defined and (item.state is undefined or item.state != "absent") and (item.proto is not defined or 'https' not in item.proto)
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@
|
||||||
status_code: 301
|
status_code: 301
|
||||||
follow_redirects: none
|
follow_redirects: none
|
||||||
validate_certs: no
|
validate_certs: no
|
||||||
with_items: "{{ nginx_sites }}"
|
loop: "{{ nginx_sites }}"
|
||||||
when: item.redirect_from is defined and (item.state is undefined or item.state != "absent") and item.proto is defined and 'https' in item.proto
|
when: item.redirect_from is defined and (item.state is undefined or item.state != "absent") and item.proto is defined and 'https' in item.proto
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@
|
||||||
url: "http://{{ item.name}}/"
|
url: "http://{{ item.name}}/"
|
||||||
return_content: yes
|
return_content: yes
|
||||||
register: p
|
register: p
|
||||||
with_items: "{{ nginx_sites }}"
|
loop: "{{ nginx_sites }}"
|
||||||
when: >
|
when: >
|
||||||
item.template is defined and
|
item.template is defined and
|
||||||
(item.template == '_php' or item.template == '_php_index' or item.template == '_php_index2')
|
(item.template == '_php' or item.template == '_php_index' or item.template == '_php_index2')
|
||||||
|
@ -430,7 +430,7 @@
|
||||||
validate_certs: no
|
validate_certs: no
|
||||||
register: sslok
|
register: sslok
|
||||||
failed_when: sslok.content.find('Index HTML test OK') == -1
|
failed_when: sslok.content.find('Index HTML test OK') == -1
|
||||||
with_items:
|
loop:
|
||||||
- 'test-ssl-predeployed.local'
|
- 'test-ssl-predeployed.local'
|
||||||
- 'test-ssl-selfsigned.local'
|
- 'test-ssl-selfsigned.local'
|
||||||
- 'test-ssl.local'
|
- 'test-ssl.local'
|
||||||
|
@ -445,7 +445,7 @@
|
||||||
follow_redirects: none
|
follow_redirects: none
|
||||||
register: sslredirok
|
register: sslredirok
|
||||||
failed_when: '"https://%s%s" % (item.name, ":" + item.port if item.port is defined else "") not in sslredirok.location'
|
failed_when: '"https://%s%s" % (item.name, ":" + item.port if item.port is defined else "") not in sslredirok.location'
|
||||||
with_items:
|
loop:
|
||||||
- name: 'test-ssl-redirect.local'
|
- name: 'test-ssl-redirect.local'
|
||||||
- name: 'test-ssl-redirect-many.local'
|
- name: 'test-ssl-redirect-many.local'
|
||||||
port: '8443'
|
port: '8443'
|
||||||
|
|
Loading…
Reference in New Issue