Fix yaml lint

debian_11
Emilien Mantel 2021-09-01 11:21:12 +02:00
parent bdddb06fcc
commit 6c7e0c2a47
18 changed files with 192 additions and 198 deletions

View File

@ -1,3 +1,5 @@
---
env:
- PLATFORM='docker-debian-stretch' ANSIBLE_VERSION='ansible>=2.6,<2.7'
- PLATFORM='docker-debian-buster' ANSIBLE_VERSION='ansible>=2.6,<2.7'

6
.yamllint.yml 100644
View File

@ -0,0 +1,6 @@
---
extends: default
rules:
line-length: disable

View File

@ -1,4 +1,5 @@
---
galaxy_info:
author: Emilien Mantel
description: Nginx for Debian / FreeBSD

View File

@ -7,7 +7,7 @@
- name: APT | Update cache
apt:
update_cache: yes
update_cache: true
cache_valid_time: 3600
changed_when: false
@ -41,7 +41,7 @@
git:
repo: 'https://github.com/Neilpang/acme.sh.git'
dest: '{{ nginx_acmesh_git_dir }}'
update: no
update: false
version: master
- name: COMMAND | Install acme.sh
@ -51,4 +51,3 @@
creates: "{{ nginx_acmesh_dir }}"
when: not acme.stat.exists

View File

@ -56,4 +56,4 @@
- name: SERVICE | Enable nginx
service:
name: nginx
enabled: yes
enabled: true

View File

@ -6,7 +6,7 @@
executable: /bin/sh
register: nginx_version
changed_when: false
check_mode: no
check_mode: false
tags:
- skip_ansible_lint
@ -22,7 +22,7 @@
executable: /bin/sh
register: shell_modules
changed_when: false
check_mode: no
check_mode: false
tags:
- skip_ansible_lint

View File

@ -5,7 +5,7 @@
- name: STAT | Get info about DH file
stat:
path: "{{ nginx_dh_path }}"
get_checksum: no
get_checksum: false
register: stat_dh_file
- name: SHELL | Get info about DH file
@ -56,8 +56,6 @@
notify: restart nginx
no_log: "{{ not nginx_debug_role }}"
- name: COMMAND | Create self-signed certificates
command: |
openssl req

View File

@ -1,2 +1 @@
---

View File

@ -1,2 +1 @@
---

View File

@ -9,7 +9,7 @@
- name: APT | Install needed packages
apt:
pkg: "{{ packages }}"
update_cache: yes
update_cache: true
cache_valid_time: 3600
state: present
vars:
@ -27,7 +27,7 @@
- name: APT | Install PHP
apt:
pkg: "{{ pkgs }}"
update_cache: yes
update_cache: true
cache_valid_time: 3600
state: present
vars:
@ -61,7 +61,7 @@
unarchive:
src: "/tmp/ngrok.zip"
dest: "/tmp"
remote_src: yes
remote_src: true
- name: SET_FACT | ngrok_path
set_fact:
@ -70,7 +70,7 @@
- name: USER | Create PHP User foo
user:
name: foo
system: yes
system: true
- name: INCLUDE_ROLE | HanXHX.php
include_role:

View File

@ -17,8 +17,6 @@
sockets:
- host: '127.0.0.1'
port: 9000
# nginx_load_modules:
# - /usr/local/libexec/nginx/ngx_http_geoip_module.so
ngrok_path: '/usr/local/bin/ngrok'
- name: PKGNG | Install needed packages
@ -30,22 +28,16 @@
- curl
- daemonize
- fcgiwrap
# - GeoIP
- jq
- nghttp2
- php74
- vim
#- name: COMMAND | Get geoip database
# command: geoipupdate.sh
# args:
# creates: /usr/local/share/GeoIP/GeoIP.dat
- name: SERVICE | Force start services
service:
name: "{{ item }}"
state: started
enabled: yes
enabled: true
register: sf
loop:
- php-fpm

View File

@ -24,7 +24,7 @@
lineinfile:
line: "set mouse="
dest: "{{ item }}/.vimrc"
create: yes
create: true
loop:
- /root
- /home/vagrant

View File

@ -39,7 +39,7 @@
{% endif %}
{% endfor %}
dest: "/etc/hosts"
unsafe_writes: yes
unsafe_writes: true
vars:
# Internal vars
@ -331,6 +331,7 @@
- name: -- CHECK FACTS --
assert:
that: "'{{ ansible_local.nginx.fact_nginx_sites[0].name[0] }}' == 'test.local'"
# --------------------------------
# Simple sites tests
# --------------------------------
@ -362,7 +363,7 @@
url: "https://{{ item.redirect_from[0] }}:{{ item.listen_ssl[0] | default(443) }}/"
status_code: 301
follow_redirects: none
validate_certs: no
validate_certs: false
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
changed_when: false
@ -373,7 +374,7 @@
- name: -- VERIFY PHP SITES --
uri:
url: "http://{{ item.name }}/"
return_content: yes
return_content: true
register: p
loop: "{{ nginx_sites }}"
when: >
@ -384,7 +385,7 @@
- name: -- VERIFY INDEX2 --
uri:
url: "http://test-php-index2.local/lorem.php?ipsum=sit&dolor=amet"
return_content: yes
return_content: true
register: p2
failed_when: p2.content.find('PHP Version') == -1
@ -402,14 +403,14 @@
status_code: 401
user: "fail"
password: "fail"
force_basic_auth: yes
force_basic_auth: true
- name: -- VERIFY AUTH BASIC OK --
uri:
url: "http://test-htpasswd.local/hello/"
user: "hanx"
password: "qwerty"
force_basic_auth: yes
force_basic_auth: true
- name: -- VERIFY AUTH BASIC FAIL GLOBAL --
uri:
@ -417,14 +418,14 @@
status_code: 401
user: "fail"
password: "fail"
force_basic_auth: yes
force_basic_auth: true
- name: -- VERIFY AUTH BASIC OK GLOBAL --
uri:
url: "http://test-htpasswd-all.local/"
user: "hanx"
password: "qwerty"
force_basic_auth: yes
force_basic_auth: true
# --------------------------------
# SSL
@ -432,8 +433,8 @@
- name: -- VERIFY SSL --
uri:
url: "https://{{ item }}/"
return_content: yes
validate_certs: no
return_content: true
validate_certs: false
register: sslok
failed_when: sslok.content.find('Index HTML test OK') == -1
loop:
@ -445,9 +446,9 @@
- name: -- VERIFY SSL REDIRECT --
uri:
url: "http://{{ item.name }}/"
validate_certs: no
validate_certs: false
status_code: 301
return_content: yes
return_content: true
follow_redirects: none
register: sslredirok
failed_when: '"https://%s%s" % (item.name, ":" + item.port if item.port is defined else "") not in sslredirok.location'
@ -464,7 +465,7 @@
- name: -- VERIFY DEFAULT SITE --
uri:
url: 'http://127.0.0.1/'
return_content: yes
return_content: true
register: vdefault
failed_when: >
vdefault.content.find('Index HTML test OK') == -1 or
@ -473,7 +474,7 @@
- name: -- VERIFY DEFAULT SITE + STUB STATUS--
uri:
url: 'http://127.0.0.1/status'
return_content: yes
return_content: true
register: vdefault_status
failed_when: >
vdefault_status.content.find('Active connections') == -1 or
@ -482,8 +483,8 @@
- name: -- VERIFY DEFAULT SSL SITE --
uri:
url: 'https://127.0.0.1/'
return_content: yes
validate_certs: no
return_content: true
validate_certs: false
register: vdefault
failed_when: >
vdefault.content.find('Index HTML test OK') == -1 or
@ -492,44 +493,37 @@
- name: -- VERIFY NOT DEFAULT SITE --
uri:
url: 'http://test-php.local/'
return_content: yes
return_content: true
register: vphp
failed_when: vphp.x_ansible_default is defined
- name: -- VERIFY NOT DEFAULT SSL SITE --
uri:
url: 'https://test-ssl.local/'
return_content: yes
validate_certs: no
return_content: true
validate_certs: false
register: notdefaultssl
failed_when: notdefaultssl.x_ansible_default is defined
# --------------------------------
# Check Proxy protocol
# --------------------------------
# Note: Debian Stretch doesn't any version of curl with "--haproxy-protocol" argument
# --------------------------------
- block:
- name: SHELL | Check HTTP proxy protocol
shell: curl -I --haproxy-protocol http://test-ssl-proxy-protocol.local:20080 | grep -qi 'X-Proxy-Protocol'
args:
executable: /bin/sh
warn: no
warn: false
changed_when: false
tags:
- skip_ansible_lint
- name: SHELL | Check HTTPS proxy protocol
shell: curl -I --haproxy-protocol -k https://test-ssl-proxy-protocol.local:20443 | grep -qi 'X-Proxy-Protocol'
args:
executable: /bin/sh
warn: no
warn: false
changed_when: false
tags:
- skip_ansible_lint
when: not (ansible_distribution == 'Debian' and ansible_distribution_major_version is version('9', 'eq'))
@ -542,5 +536,3 @@
executable: /bin/sh
changed_when: false
when: nginx_auto_config_httpv2 and 'http_v2' in nginx_modules
tags:
- skip_ansible_lint

View File

@ -1,3 +1,5 @@
---
nginx_events_use: 'epoll'
nginx_pid: '/run/nginx.pid'
nginx_etc_dir: '/etc/nginx'

View File

@ -1,3 +1,5 @@
---
nginx_events_use: 'kqueue'
nginx_pid: '/var/run/nginx.pid'
nginx_etc_dir: '/usr/local/etc/nginx'

View File

@ -1,3 +1,5 @@
---
nginx_upstream_server_params:
- key: 'weight'
default: 1