diff --git a/.github/workflows/requirements/requirements_molecule.txt b/.github/workflows/requirements/requirements_molecule.txt index 0984b5d7..77632221 100644 --- a/.github/workflows/requirements/requirements_molecule.txt +++ b/.github/workflows/requirements/requirements_molecule.txt @@ -1,5 +1,5 @@ ansible-base==2.10.7 -ansible-lint==4.3.7 +ansible-lint==5.0.4 yamllint==1.26.0 molecule[docker]==3.2.4 docker==4.4.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 30d8b1ce..ec9d26a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,14 +48,15 @@ Replace Ansible community distribution with Ansible base and add the necessary e ENHANCEMENTS: * Add support for NGINX's `index` directive to the `server` block within the template config parameters. -* Update Ansible base to `2.10.7`, Molecule to `3.2.4`, yamllint to `1.26.0` and Docker Python SDK to `4.4.4`. +* Update Ansible base to `2.10.7`, Ansible Lint to `5.0.4`, Molecule to `3.2.4`, yamllint to `1.26.0` and Docker Python SDK to `4.4.4`. +* Consolidate Molecule testing scenarios to address changes introduced in Ansible Lint `5.*`. * Specify GitHub actions Ubuntu release. * Minor GitHub template tweaks, including the creation of a SECURITY doc. BUG FIXES: * Add `state` parameter to package module in Molecule verification tests. -* In App Protect environments on SELinux enforced systems, the `nginx -t` handler fails when run from a directory that the nginx process' user does not have access to. +* In NGINX App Protect environments on SELinux enforced systems, the `nginx -t` handler fails when run from a directory that the NGINX process' user does not have access to. * Fix missing GRPC boolean check in GRPC template. ## 0.3.3 (January 28, 2021) diff --git a/meta/main.yml b/meta/main.yml index 1c0de199..7e95c505 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -3,6 +3,7 @@ galaxy_info: author: Alessandro Fael Garcia description: Official Ansible role for configuring NGINX role_name: nginx_config + namespace: nginxinc # Ansible Lint requirement company: F5 Networks, Inc. license: Apache License, Version 2.0 diff --git a/molecule/cleanup_module/molecule.yml b/molecule/cleanup_module/molecule.yml index e7ed3904..9f95fda1 100644 --- a/molecule/cleanup_module/molecule.yml +++ b/molecule/cleanup_module/molecule.yml @@ -2,7 +2,7 @@ dependency: name: galaxy options: - role-file: molecule/common/playbooks/oss_requirements.yml + role-file: molecule/common/requirements/oss_requirements.yml driver: name: docker lint: | @@ -41,4 +41,6 @@ platforms: provisioner: name: ansible playbooks: - prepare: ../common/playbooks/oss_prepare.yml + prepare: prepare.yml + converge: converge.yml + verify: verify.yml diff --git a/molecule/common/playbooks/oss_prepare.yml b/molecule/cleanup_module/prepare.yml similarity index 100% rename from molecule/common/playbooks/oss_prepare.yml rename to molecule/cleanup_module/prepare.yml diff --git a/molecule/common/playbooks/oss_requirements.yml b/molecule/common/requirements/oss_requirements.yml similarity index 100% rename from molecule/common/playbooks/oss_requirements.yml rename to molecule/common/requirements/oss_requirements.yml diff --git a/molecule/common/playbooks/plus_requirements.yml b/molecule/common/requirements/plus_requirements.yml similarity index 100% rename from molecule/common/playbooks/plus_requirements.yml rename to molecule/common/requirements/plus_requirements.yml diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index e7ed3904..9f95fda1 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -2,7 +2,7 @@ dependency: name: galaxy options: - role-file: molecule/common/playbooks/oss_requirements.yml + role-file: molecule/common/requirements/oss_requirements.yml driver: name: docker lint: | @@ -41,4 +41,6 @@ platforms: provisioner: name: ansible playbooks: - prepare: ../common/playbooks/oss_prepare.yml + prepare: prepare.yml + converge: converge.yml + verify: verify.yml diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml new file mode 100644 index 00000000..bed56773 --- /dev/null +++ b/molecule/default/prepare.yml @@ -0,0 +1,10 @@ +--- +- name: Prepare + hosts: all + tasks: + - name: Install NGINX + include_role: + name: nginxinc.nginx + vars: + nginx_modules: + - njs diff --git a/molecule/plus/molecule.yml b/molecule/plus/molecule.yml index 67752755..53d573fa 100644 --- a/molecule/plus/molecule.yml +++ b/molecule/plus/molecule.yml @@ -2,7 +2,7 @@ dependency: name: galaxy options: - role-file: molecule/common/playbooks/plus_requirements.yml + role-file: molecule/common/requirements/plus_requirements.yml driver: name: docker lint: | @@ -34,4 +34,6 @@ platforms: provisioner: name: ansible playbooks: - prepare: ../common/playbooks/plus_prepare.yml + prepare: prepare.yml + converge: converge.yml + verify: verify.yml diff --git a/molecule/common/playbooks/plus_prepare.yml b/molecule/plus/prepare.yml similarity index 84% rename from molecule/common/playbooks/plus_prepare.yml rename to molecule/plus/prepare.yml index 0ffc89b5..b9c92778 100644 --- a/molecule/common/playbooks/plus_prepare.yml +++ b/molecule/plus/prepare.yml @@ -6,14 +6,14 @@ - name: Create ephemeral license certificate file from b64 decoded env var copy: content: "{{ lookup('env','NGINX_CRT') | b64decode }}" - dest: ../files/license/nginx-repo.crt + dest: ../common/files/license/nginx-repo.crt force: no 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 + dest: ../common/files/license/nginx-repo.key force: no mode: 0444 @@ -26,8 +26,8 @@ vars: nginx_type: plus nginx_license: - certificate: ../files/license/nginx-repo.crt - key: ../files/license/nginx-repo.key + certificate: ../common/files/license/nginx-repo.crt + key: ../common/files/license/nginx-repo.key nginx_remove_license: false - name: Install NGINX App Protect diff --git a/molecule/stable_push/molecule.yml b/molecule/stable_push/molecule.yml index e7ed3904..9f95fda1 100644 --- a/molecule/stable_push/molecule.yml +++ b/molecule/stable_push/molecule.yml @@ -2,7 +2,7 @@ dependency: name: galaxy options: - role-file: molecule/common/playbooks/oss_requirements.yml + role-file: molecule/common/requirements/oss_requirements.yml driver: name: docker lint: | @@ -41,4 +41,6 @@ platforms: provisioner: name: ansible playbooks: - prepare: ../common/playbooks/oss_prepare.yml + prepare: prepare.yml + converge: converge.yml + verify: verify.yml diff --git a/molecule/stable_push/prepare.yml b/molecule/stable_push/prepare.yml new file mode 100644 index 00000000..561d3908 --- /dev/null +++ b/molecule/stable_push/prepare.yml @@ -0,0 +1,7 @@ +--- +- name: Prepare + hosts: all + tasks: + - name: Install NGINX + include_role: + name: nginxinc.nginx