diff --git a/.ansible-lint b/.ansible-lint index 27105069..04a344e1 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -3,4 +3,5 @@ offline: true exclude_paths: - .github/ skip_list: + - schema[meta] - yaml[line-length] diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dffc9e9..e07a21a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,22 @@ # Changelog -## 0.6.1 (Unreleased) +## 0.7.0 (July 6, 2023) BREAKING CHANGES: -- `spdy` parameter `listen` is removed -- `http2` parameter for `listen` is removed +- Two parameters have been removed from the `listen` dictionary: + - `spdy` -> This parameter is no longer supported. + - `http2` -> This parameter has been replaced by the `http2` directive. To enable HTTP2, use the `enable` parameter in the newly implemented `http2` module/dictionary: + + ```yaml + http2: + enable: true + ``` ENHANCEMENTS: +- Initial pass at implementing directives for the `http2` (officially named `http_v2`) module. - Bump the Ansible `community.general` collection to `7.1.0`, `ansible.posix` collection to `1.5.4`, `community.crypto` collection to `2.14.0`, and `community.docker` collection to `3.4.7`. -- Options from `http_v2` module are implemented. BUG FIXES: diff --git a/README.md b/README.md index c33b559b..c256d5ae 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Ansible Galaxy](https://img.shields.io/badge/galaxy-nginxinc.nginx__config-5bbdbf.svg)](https://galaxy.ansible.com/nginxinc/nginx_config) [![Molecule CI/CD](https://github.com/nginxinc/ansible-role-nginx-config/workflows/Molecule%20CI/CD/badge.svg)](https://github.com/nginxinc/ansible-role-nginx-config/actions) [![License](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) # 👾 *Help make the NGINX config Ansible role better by participating in our [survey](https://forms.office.com/Pages/ResponsePage.aspx?id=L_093Ttq0UCb4L-DJ9gcUKLQ7uTJaE1PitM_37KR881UM0NCWkY5UlE5MUYyWU1aTUcxV0NRUllJSC4u)!* 👾 @@ -76,84 +77,9 @@ git clone https://github.com/nginxinc/ansible-role-nginx-config.git ## Platforms -The NGINX config Ansible role supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html#mainline) and [NGINX Plus](https://www.nginx.com/products/technical-specs/): - -### NGINX Open Source - -```yaml -AlmaLinux: - - 8 - - 9 -Alpine: - - 3.14 - - 3.15 - - 3.16 - - 3.17 -Amazon Linux: - - 2 -CentOS: - - 7.4+ -Debian: - - bullseye (11) -Oracle Linux: - - 7 - - 8 - - 9 -Red Hat: - - 7.4+ - - 8 - - 9 -Rocky Linux: - - 8 - - 9 -SUSE/SLES: - - 12 - - 15 -Ubuntu: - - bionic (18.04) - - focal (20.04) - - impish (21.10) - - jammy (22.04) -``` +The NGINX config Ansible role supports all platforms supported by [NGINX Open Source](https://nginx.org/en/linux_packages.html#mainline) and [NGINX Plus](https://www.nginx.com/products/technical-specs/). -### NGINX Plus - -```yaml -AlmaLinux: - - 8 - - 9 -Alpine: - - 3.13 - - 3.14 - - 3.15 - - 3.16 - - 3.17 -Amazon Linux 2: - - any -CentOS: - - 7.4+ -Debian: - - bullseye (11) -FreeBSD: - - 12.1+ - - 13 -Oracle Linux: - - 7.4+ -Red Hat: - - 7.4+ - - 8 - - 9 -Rocky Linux: - - 8 - - 9 -SUSE/SLES: - - 12 - - 15 -Ubuntu: - - bionic (18.04) - - focal (20.04) - - jammy (22.04) -``` +***Note:** You should be able to use this role to configure any NGINX installation -- wherever/however it's been installed -- at your own risk. Any potential bugs with the role involving unsupported installation methods/platforms will be addressed in a best effort manner and might be outright dismissed.* ## Role Variables diff --git a/defaults/main/template.yml b/defaults/main/template.yml index 7be9b071..b55566e8 100644 --- a/defaults/main/template.yml +++ b/defaults/main/template.yml @@ -272,12 +272,12 @@ nginx_config_http_template: variables_hash_bucket_size: 64 # Available only in the 'http' context variables_hash_max_size: 1024 # Available only in the 'http' context http2: # Configure HTTP2 - enable: false - body_preread_size: 64k + enable: false # Boolean -- Not available in the 'location' context + body_preread_size: 64k # Not available in the 'location' context chunk_size: 8k - max_concurrent_streams: 128 - recv_buffer_size: 256k - recv_timeout: 20s + max_concurrent_streams: 128 # Number -- Not available in the 'location' context + recv_buffer_size: 256k # Only available in the 'http' context + recv_timeout: 20s # Not available in the 'location' context ssl: # Configure SSL buffer_size: 16k certificate: /path/to/file # String or a list of strings diff --git a/meta/main.yml b/meta/main.yml index bb61ee9f..a956e583 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -7,7 +7,7 @@ galaxy_info: license: Apache License, Version 2.0 - min_ansible_version: "2.12" + min_ansible_version: '2.12' platforms: - name: Alpine @@ -15,13 +15,15 @@ galaxy_info: - name: Amazon Linux versions: ['2', '2023'] - name: Debian - versions: [bullseye] + versions: [bullseye, bookworm] - name: EL versions: ['7', '8', '9'] - name: FreeBSD - versions: ['12.1'] + versions: ['12.1', '12.2', '12.3', '12.4', '13.0', '13.1', '13.2'] + - name: OracleLinux + versions: ['7', '8', '9'] - name: Ubuntu - versions: [bionic, focal, impish, jammy] + versions: [focal, jammy, kinetic, lunar] - name: SLES versions: ['12', '15'] diff --git a/templates/http/modules.j2 b/templates/http/modules.j2 index 20895e0b..c21dbe57 100644 --- a/templates/http/modules.j2 +++ b/templates/http/modules.j2 @@ -333,7 +333,6 @@ sub_filter_types {{ sub_filter['types'] if sub_filter['types'] is string else su {# NGINX HTTP v2 -- ngx_http_v2_module #} {% macro http2(http2, scope='http') %} -{% if http2 is defined %} {% if scope != 'location' %}{# The following scoped directives are not available in the 'location' context #} {% if http2['enabled'] is defined and http2['enabled'] is boolean %} http2 {{ http2['enabled'] | ternary('on', 'off') }}; @@ -341,7 +340,7 @@ http2 {{ http2['enabled'] | ternary('on', 'off') }}; {% if http2['body_preread_size'] is defined %} http2_body_preread_size {{ http2['body_preread_size'] }}; {% endif %} -{% if http2['max_concurrent_streams'] is defined %} +{% if http2['max_concurrent_streams'] is defined and http2['max_concurrent_streams'] is number %} http2_max_concurrent_streams {{ http2['max_concurrent_streams'] }}; {% endif %} {% endif %} @@ -351,6 +350,5 @@ http2_recv_buffer_size {{ http2['recv_buffer_size'] }}; {% if http2['chunk_size'] is defined %} http2_chunk_size {{ http2['chunk_size'] }}; {% endif %} -{% endif %} {% endmacro %}