Replace "yes"/"no" boolean values with "true"/"false" (#414)

This commit is contained in:
Alessandro Fael Garcia 2021-06-02 17:47:44 +02:00 committed by GitHub
parent d52f867761
commit fb391a09cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 84 additions and 84 deletions

View File

@ -1,6 +1,6 @@
---
name: Ansible Galaxy import
on:
"on":
release:
types:
- published

View File

@ -1,6 +1,6 @@
---
name: Molecule CI/CD
on:
"on":
pull_request:
branches:
- main

View File

@ -1,6 +1,6 @@
---
name: Release Drafter
on:
"on":
pull_request:
types:
- opened

View File

@ -10,4 +10,3 @@ rules:
level: error
comments-indentation: disable
line-length: disable
truthy: disable

View File

@ -11,6 +11,7 @@ ENHANCEMENTS:
* Replace Ansible base with Ansible core. Ansible core will be the "core" Ansible release moving forward from Ansible `2.11`.
* Update GitHub actions to add a workflow dispatch option.
* Replace "yes"/"no" boolean values with "true"/"false" to comply with YAML spec `1.2`.
BUG FIXES:

View File

@ -1,13 +1,13 @@
---
- name: (Handler) Systemd daemon-reload
systemd:
daemon_reload: yes
daemon_reload: true
- name: (Handler) Start/reload NGINX
service:
name: nginx
state: reloaded
enabled: yes
enabled: true
when:
- nginx_start | bool
- not ansible_check_mode | bool
@ -18,8 +18,8 @@
args:
chdir: /etc/nginx/
register: config_check
ignore_errors: yes
check_mode: no
ignore_errors: true
check_mode: false
changed_when: false
listen: (Handler) Run NGINX

View File

@ -6,7 +6,7 @@
package:
name: nginx
state: present
check_mode: yes
check_mode: true
register: install
failed_when: (install is changed) or (install is failed)
@ -14,8 +14,8 @@
service:
name: nginx
state: started
enabled: yes
check_mode: yes
enabled: true
check_mode: true
register: service
failed_when: (service is changed) or (service is failed)

View File

@ -6,7 +6,7 @@
package:
name: nginx
state: present
check_mode: yes
check_mode: true
register: install
failed_when: (install is changed) or (install is failed)
@ -14,8 +14,8 @@
service:
name: nginx
state: started
enabled: yes
check_mode: yes
enabled: true
check_mode: true
register: service
failed_when: (service is changed) or (service is failed)

View File

@ -7,12 +7,12 @@
copy:
content: "{{ lookup('env','NGINX_CRT') | b64decode }}"
dest: ../../files/license/nginx-repo.crt
force: no
force: false
mode: 0444
- name: Create ephemeral license key file from b64 decoded env var
copy:
content: "{{ lookup('env','NGINX_KEY') | b64decode }}"
dest: ../../files/license/nginx-repo.key
force: no
force: false
mode: 0444

View File

@ -6,7 +6,7 @@
package:
name: nginx-plus
state: present
check_mode: yes
check_mode: true
register: install
failed_when: (install is changed) or (install is failed)
@ -14,8 +14,8 @@
service:
name: nginx
state: started
enabled: yes
check_mode: yes
enabled: true
check_mode: true
register: service
failed_when: (service is changed) or (service is failed)

View File

@ -6,8 +6,8 @@
service:
name: nginx
state: started
enabled: yes
check_mode: yes
enabled: true
check_mode: true
register: service
failed_when: (service is changed) or (service is failed)

View File

@ -10,7 +10,7 @@
- name: Copy NGINX configurator agent configuration template
copy:
remote_src: yes
remote_src: true
src: /etc/amplify-agent/agent.conf.default
dest: /etc/amplify-agent/agent.conf
mode: 0644

View File

@ -4,7 +4,7 @@
filename: nginx-amplify
repo: "deb [arch=amd64] https://packages.amplify.nginx.com/{{ ansible_facts['distribution'] | lower }}/
{{ ansible_facts['distribution_release'] | lower }} amplify-agent"
update_cache: yes
update_cache: true
mode: 0644
when: ansible_facts['distribution_release'] != "focal"
@ -12,6 +12,6 @@
apt_repository:
filename: nginx-amplify
repo: deb [arch=amd64] https://packages.amplify.nginx.com/py3/ubuntu focal amplify-agent
update_cache: yes
update_cache: true
mode: 0644
when: ansible_facts['distribution_release'] == "focal"

View File

@ -4,6 +4,6 @@
name: nginx-amplify
baseurl: http://packages.amplify.nginx.com/{{ (ansible_facts['distribution'] == "Amazon") | ternary('amzn/', 'centos/') }}/$releasever/$basearch/
description: NGINX Amplify Agent
enabled: yes
gpgcheck: yes
enabled: true
gpgcheck: true
mode: 0644

View File

@ -2,7 +2,7 @@
- name: Register NGINX config
command: nginx -T
ignore_errors: "{{ ansible_check_mode }}"
check_mode: no
check_mode: false
changed_when: false
register: config_full

View File

@ -27,5 +27,5 @@
rpm_key:
fingerprint: 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
key: "{{ keysite }}"
validate_certs: "{{ (ansible_facts['distribution_major_version'] is version('6', '==')) | ternary('no', 'yes') }}"
validate_certs: "{{ (ansible_facts['distribution_major_version'] is version('6', '==')) | ternary('false', 'true') }}"
when: ansible_facts['os_family'] in ['RedHat', 'Suse']

View File

@ -8,7 +8,7 @@
when:
- nginx_install | bool
- (nginx_install_from == "nginx_repository" or nginx_type == "plus")
ignore_errors: yes
ignore_errors: true
tags: nginx_check_support
- name: Set up prerequisites

View File

@ -10,6 +10,6 @@
name: "nginx{{ nginx_version | default('') }}"
repository: "{{ nginx_repository | default(nginx_default_repository_alpine) }}"
state: "{{ nginx_state }}"
update_cache: yes
update_cache: true
ignore_errors: "{{ ansible_check_mode }}"
notify: (Handler) Run NGINX

View File

@ -37,7 +37,7 @@
- name: (OpenBSD) Install NGINX package
openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
build: no
build: false
state: "{{ nginx_state }}"
when: nginx_bsd_install_packages | bool
notify: (Handler) Run NGINX
@ -45,7 +45,7 @@
- name: (OpenBSD) Install NGINX port
openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
build: yes
build: true
state: "{{ nginx_state }}"
when: not nginx_bsd_install_packages | bool
notify: (Handler) Run NGINX

View File

@ -3,7 +3,7 @@
apt_repository:
filename: nginx
repo: "{{ item }}"
update_cache: yes
update_cache: true
mode: 0644
loop: "{{ nginx_repository | default(nginx_default_repository_debian) }}"

View File

@ -4,15 +4,15 @@
name: nginx
baseurl: "{{ nginx_repository | default(nginx_default_repository_redhat) }}"
description: NGINX Repository
enabled: yes
gpgcheck: yes
enabled: true
gpgcheck: true
mode: 0644
when: ansible_facts['distribution_major_version'] is version('8', '<')
- name: (CentOS/RHEL 8) Configure NGINX repository
blockinfile:
path: /etc/yum.repos.d/nginx.repo
create: yes
create: true
block: |
[nginx]
baseurl = {{ nginx_repository | default(nginx_default_repository_redhat) }}
@ -29,6 +29,6 @@
state: "{{ nginx_state }}"
disablerepo: "*"
enablerepo: nginx
update_cache: yes
update_cache: true
ignore_errors: "{{ ansible_check_mode }}"
notify: (Handler) Run NGINX

View File

@ -9,7 +9,7 @@
- python3
- python3-pip
- python3-devel
update_cache: yes
update_cache: true
- name: (Centos/RHEL 8) Set Python 3 as default
alternatives:
@ -33,14 +33,14 @@
- perl-core
- wget
- zlib-devel
update_cache: yes
update_cache: true
when: ansible_facts['os_family'] == "RedHat"
- name: (Debian) Install backports repo for 'buster'
apt_repository:
filename: buster-backports
repo: deb http://ftp.us.debian.org/debian buster-backports main
update_cache: yes
update_cache: true
mode: 0644
when: ansible_facts['distribution_release'] == "buster"
@ -54,7 +54,7 @@
- perl
- tar
- zlib1g-dev
update_cache: yes
update_cache: true
when: ansible_facts['os_family'] == "Debian"
- name: (Alpine Linux) Install build tools
@ -69,14 +69,14 @@
- linux-headers
- tar
- wget
update_cache: yes
update_cache: true
when: ansible_facts['os_family'] == "Alpine"
- name: (Alpine Linux) Enable OpenRC
copy:
content: ""
dest: /run/openrc/softlevel
force: no
force: false
owner: root
mode: 0644
when: ansible_facts['os_family'] == "Alpine"
@ -102,7 +102,7 @@
- name: (CentOS/RHEL) Install PCRE dependency from package
yum:
name: pcre-devel
update_cache: yes
update_cache: true
when:
- nginx_install_source_pcre | bool
- ansible_facts['os_family'] == "RedHat"
@ -110,7 +110,7 @@
- name: (Debian/Ubuntu) Install PCRE dependency from package
apt:
name: libpcre3-dev
update_cache: yes
update_cache: true
when:
- nginx_install_source_pcre | bool
- ansible_facts['os_family'] == "Debian"
@ -118,7 +118,7 @@
- name: (Alpine Linux) Install PCRE dependency from package
apk:
name: pcre-dev
update_cache: yes
update_cache: true
when:
- nginx_install_source_pcre | bool
- ansible_facts['os_family'] == "Alpine"
@ -131,12 +131,12 @@
dest: "/tmp/{{ pcre_version }}.tar.gz"
mode: 0600
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
| ternary('no', 'yes') }}"
| ternary('false', 'true') }}"
register: pcre_source
- name: Unpack PCRE dependency
unarchive:
copy: no
copy: false
dest: /tmp/
src: "{{ pcre_source.dest }}"
mode: 0700
@ -162,7 +162,7 @@
- name: (Centos/RHEL) Install ZLib dependency from package
yum:
name: zlib-devel
update_cache: yes
update_cache: true
when:
- nginx_install_source_zlib | bool
- ansible_facts['os_family'] == "RedHat"
@ -178,7 +178,7 @@
- name: (Alpine Linux) Install ZLib dependency from package
apk:
name: zlib-dev
update_cache: yes
update_cache: true
when:
- nginx_install_source_zlib | bool
- ansible_facts['os_family'] == "Alpine"
@ -191,12 +191,12 @@
dest: "/tmp/{{ zlib_version }}.tar.gz"
mode: 0600
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
| ternary('no', 'yes') }}"
| ternary('false', 'true') }}"
register: zlib_source
- name: Unpack ZLib dependency
unarchive:
copy: no
copy: false
dest: /tmp/
src: "{{ zlib_source.dest }}"
mode: 0700
@ -222,7 +222,7 @@
- name: (CentOS/RHEL) Install OpenSSL dependency from package
yum:
name: openssl-devel
update_cache: yes
update_cache: true
when:
- nginx_install_source_openssl | bool
- ansible_facts['os_family'] == "RedHat"
@ -230,7 +230,7 @@
- name: (Debian/Ubuntu) Install OpenSSL dependency from package
apt:
name: libssl-dev
update_cache: yes
update_cache: true
when:
- nginx_install_source_openssl | bool
- ansible_facts['os_family'] == "Debian"
@ -238,7 +238,7 @@
- name: (Alpine Linux) Install OpenSSL dependency from package
apk:
name: openssl-dev
update_cache: yes
update_cache: true
when:
- nginx_install_source_openssl | bool
- ansible_facts['os_family'] == "Alpine"
@ -251,12 +251,12 @@
dest: "/tmp/{{ openssl_version }}.tar.gz"
mode: 0600
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
| ternary('no', 'yes') }}"
| ternary('false', 'true') }}"
register: openssl_source
- name: Unpack OpenSSL dependency
unarchive:
copy: no
copy: false
dest: /tmp/
src: "{{ openssl_source.dest }}"
mode: 0700
@ -284,10 +284,10 @@
- name: Fetch NGINX version
uri:
url: https://version.nginx.com/nginx/{{ nginx_branch }}
return_content: yes
return_content: true
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
| ternary('no', 'yes') }}"
check_mode: no
| ternary('false', 'true') }}"
check_mode: false
register: nginx_versions
- name: Set NGINX version
@ -297,7 +297,7 @@
- name: Check for NGINX install
stat:
path: /usr/sbin/nginx
follow: yes
follow: true
register: nginx_result
- name: Add NGINX user
@ -312,12 +312,12 @@
dest: "/tmp/{{ nginx_version }}.tar.gz"
mode: 0600
validate_certs: "{{ (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] is version('6', '=='))
| ternary('no', 'yes') }}"
| ternary('false', 'true') }}"
register: nginx_source
- name: Unpack NGINX
unarchive:
copy: no
copy: false
dest: /tmp/
src: "{{ nginx_source.dest }}"
mode: 0755
@ -362,10 +362,10 @@
- name: Enable systemd NGINX service file
systemd:
daemon_reload: yes
daemon_reload: true
name: nginx
state: restarted
enabled: yes
enabled: true
when: ansible_facts['service_mgr'] == "systemd"
notify: "(Handler) Run NGINX"

View File

@ -8,7 +8,7 @@
zypper:
name: "nginx{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
disable_recommends: no
update_cache: yes
disable_recommends: false
update_cache: true
ignore_errors: "{{ ansible_check_mode }}"
notify: (Handler) Run NGINX

View File

@ -2,7 +2,7 @@
- name: (Debian/Ubuntu) {{ nginx_license_status is defined | ternary('Remove', 'Configure') }} NGINX Plus license verification
blockinfile:
path: /etc/apt/apt.conf.d/90nginx
create: yes
create: true
block: |
Acquire::https::{{ (nginx_repository | default(nginx_plus_default_repository_debian)) | regex_search('(?<=https://)[^/]*') }}::Verify-Peer "true";
Acquire::https::{{ (nginx_repository | default(nginx_plus_default_repository_debian)) | regex_search('(?<=https://)[^/]*') }}::Verify-Host "true";
@ -15,7 +15,7 @@
apt_repository:
filename: nginx-plus
repo: "{{ nginx_repository | default(nginx_plus_default_repository_debian) }}"
update_cache: no
update_cache: false
state: "{{ nginx_license_status | default ('present') }}"
mode: 0644
@ -23,7 +23,7 @@
apt:
name: "nginx-plus{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
update_cache: yes
update_cache: true
ignore_errors: "{{ ansible_check_mode }}"
when: nginx_license_status is not defined
notify: (Handler) Run NGINX

View File

@ -11,7 +11,7 @@
- name: (FreeBSD) {{ nginx_license_status is defined | ternary('Remove', 'Configure') }} NGINX Plus repository
blockinfile:
path: /etc/pkg/nginx-plus.conf
create: yes
create: true
block: |
nginx-plus: {
URL: {{ nginx_repository | default(nginx_plus_default_repository_freebsd) }}

View File

@ -7,8 +7,8 @@
description: NGINX Plus Repository
sslclientcert: /etc/ssl/nginx/nginx-repo.crt
sslclientkey: /etc/ssl/nginx/nginx-repo.key
enabled: yes
gpgcheck: yes
enabled: true
gpgcheck: true
state: "{{ nginx_license_status | default ('present') }}"
mode: 0644
@ -16,7 +16,7 @@
yum:
name: "nginx-plus{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
update_cache: yes
update_cache: true
ignore_errors: "{{ ansible_check_mode }}"
when: nginx_license_status is not defined
notify: (Handler) Run NGINX

View File

@ -16,7 +16,7 @@
zypper:
name: "nginx-plus{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
update_cache: yes
update_cache: true
ignore_errors: "{{ ansible_check_mode }}"
when: nginx_license_status is not defined
notify: (Handler) Run NGINX

View File

@ -11,7 +11,7 @@
copy:
src: "{{ item }}"
dest: /etc/ssl/nginx
decrypt: yes
decrypt: true
mode: 0444
loop:
- "{{ nginx_license['certificate'] }}"
@ -30,13 +30,13 @@
copy:
src: "{{ nginx_license['key'] }}"
dest: /etc/apk/cert.key
decrypt: yes
decrypt: true
mode: 0444
- name: (Alpine Linux) Copy NGINX Plus certificate
copy:
src: "{{ nginx_license['certificate'] }}"
dest: /etc/apk/cert.pem
decrypt: yes
decrypt: true
mode: 0444
when: ansible_facts['os_family'] == "Alpine"

View File

@ -2,13 +2,13 @@
- name: (Alpine Linux) Install dependencies
apk:
name: "{{ nginx_alpine_dependencies }}"
update_cache: yes
update_cache: true
when: ansible_facts['os_family'] == "Alpine"
- name: (Debian/Ubuntu) Install dependencies
apt:
name: "{{ nginx_debian_dependencies }}"
update_cache: yes
update_cache: true
when: ansible_facts['os_family'] == "Debian"
- name: (Amazon Linux/CentOS/Oracle Linux/RHEL) Install dependencies

View File

@ -25,14 +25,14 @@
- name: Allow SELinux HTTP network connections
seboolean:
name: httpd_can_network_connect
state: yes
persistent: yes
state: true
persistent: true
- name: Allow SELinux HTTP network connections
seboolean:
name: httpd_can_network_relay
state: yes
persistent: yes
state: true
persistent: true
- name: (DEPRECATED) Allow SELinux TCP connections on status ports
seport: