Fix Ansible Lint

This commit is contained in:
Emilien Mantel
2021-09-01 11:45:44 +02:00
parent 6c7e0c2a47
commit a2780d3d95
11 changed files with 79 additions and 6 deletions

View File

@@ -25,6 +25,7 @@
state: present
vars:
packages:
- bash
- curl
- daemonize
- fcgiwrap

View File

@@ -13,16 +13,25 @@
file:
path: "{{ int_ansible_ssl_dir }}"
state: directory
mode: 0750
owner: root
group: root
- name: COPY | Deploy test certificate
copy:
src: "file/test.crt"
dest: "{{ int_ansible_ssl_dir }}/test.crt"
mode: 0640
owner: root
group: root
- name: COPY | Deploy test key
copy:
src: "file/test.key"
dest: "{{ int_ansible_ssl_dir }}/test.key"
mode: 0640
owner: root
group: root
- name: COPY | Add all hosts in /etc/hosts
copy:
@@ -39,6 +48,9 @@
{% endif %}
{% endfor %}
dest: "/etc/hosts"
mode: 0644
owner: root
group: root
unsafe_writes: true
vars:
@@ -296,6 +308,9 @@
copy:
dest: "{{ nginx_root }}/{{ item }}/public/index.php"
content: "<?php phpinfo();"
mode: 0644
owner: root
group: root
loop:
- 'test-php.local'
- 'test-php-index.local'
@@ -305,6 +320,9 @@
copy:
dest: "{{ item }}/index.html"
content: "Index HTML test OK\n"
mode: 0644
owner: root
group: root
loop:
- '{{ nginx_root }}/first-test/public'
- '/var/tmp'
@@ -319,11 +337,17 @@
file:
path: "{{ nginx_root }}/test-htpasswd.local/public/hello"
state: directory
mode: 0755
owner: root
group: root
- name: -- Add HTML file hello --
copy:
dest: "{{ nginx_root }}/test-htpasswd.local/public/hello/index.html"
content: "hello\n"
mode: 0644
owner: root
group: root
# --------------------------------
# Test custom facts
@@ -512,16 +536,16 @@
- block:
- name: SHELL | Check HTTP proxy protocol
shell: curl -I --haproxy-protocol http://test-ssl-proxy-protocol.local:20080 | grep -qi 'X-Proxy-Protocol'
shell: set -o pipefail && curl -I --haproxy-protocol http://test-ssl-proxy-protocol.local:20080 | grep -qi 'X-Proxy-Protocol'
args:
executable: /bin/sh
executable: /bin/bash
warn: false
changed_when: false
- name: SHELL | Check HTTPS proxy protocol
shell: curl -I --haproxy-protocol -k https://test-ssl-proxy-protocol.local:20443 | grep -qi 'X-Proxy-Protocol'
shell: set -o pipefail && curl -I --haproxy-protocol -k https://test-ssl-proxy-protocol.local:20443 | grep -qi 'X-Proxy-Protocol'
args:
executable: /bin/sh
executable: /bin/bash
warn: false
changed_when: false
@@ -531,8 +555,8 @@
# Check HTTP2
# --------------------------------
- name: SHELL | Check HTTP2
shell: nghttp -nv https://localhost 2> /dev/null | grep -q h2
shell: set -o pipefail && nghttp -nv https://localhost 2> /dev/null | grep -q h2
args:
executable: /bin/sh
executable: /bin/bash
changed_when: false
when: nginx_auto_config_httpv2 and 'http_v2' in nginx_modules