From 1c1c62b418ee6557e23442134d780ff3ac5c2945 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Thu, 25 Mar 2021 16:01:39 +0100 Subject: [PATCH 1/5] Name it properly. --- tasks/assert.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/assert.yml b/tasks/assert.yml index 44a854b..935747f 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -203,7 +203,7 @@ when: - tomcat_access_log_enabled | bool -- name: test if item in tomcat_instances is set correctly +- name: test if item.name in tomcat_instances is set correctly ansible.builtin.assert: that: - item.name is defined From 6db261ded718cb7f57ddd1534f59dff8db4f2e5b Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Thu, 25 Mar 2021 16:03:57 +0100 Subject: [PATCH 2/5] Set a sane default and assert the value for packet_size. --- .gitignore | 1 + .pre-commit-config.yaml | 2 +- README.md | 1 + defaults/main.yml | 2 +- tasks/assert.yml | 13 +++++++++++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c15d16a..ad73ff6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ *.swp .tox .cache +.DS_Store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ec1005b..af7ef32 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: args: [-c=.yamllint] - repo: https://github.com/robertdebock/pre-commit - rev: v1.2.1 + rev: v1.2.2 hooks: - id: ansible_role_find_unused_variable - id: ansible_role_find_empty_files diff --git a/README.md b/README.md index 95ff1d4..f9d5b6c 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,7 @@ tomcat_instances: ajp_secret: "" # You can pick an address per instance: # address: 127.0.0.1 + packet_size: "8192" java_opts: - name: JRE_HOME value: "{{ tomcat_jre_home }}" diff --git a/defaults/main.yml b/defaults/main.yml index 1bf1dbd..7f15df4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -49,7 +49,7 @@ tomcat_instances: ajp_secret: "" # You can pick an address per instance: # address: 127.0.0.1 - packet_size: "" + packet_size: "8192" java_opts: - name: JRE_HOME value: "{{ tomcat_jre_home }}" diff --git a/tasks/assert.yml b/tasks/assert.yml index 935747f..1ba10b5 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -377,3 +377,16 @@ label: "{{ item.name }}" when: - item.service_enabled is defined + +- name: test if item.packet_size in tomcat_instances is set correctly + ansible.builtin.assert: + that: + - item.packet_size is number + - item.packet_size > 0 + - item.packet_size <= 65536 + quiet: yes + loop: "{{ tomcat_instances }}" + loop_control: + label: "{{ item.name }}" + when: + - item.packet_size is defined From 125150961fb15929434be455cf2a30c3455e8e51 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 29 Mar 2021 01:00:13 +0200 Subject: [PATCH 3/5] Fix GitLab build-status badge in the documentation. --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f9d5b6c..b209c6a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Install and configure tomcat on your system. |GitHub|GitLab|Quality|Downloads|Version| |------|------|-------|---------|-------| -|[![github](https://github.com/robertdebock/ansible-role-tomcat/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-tomcat/actions)|[![gitlab](https://gitlab.com/robertdebock/ansible-role-tomcat/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-tomcat)|[![quality](https://img.shields.io/ansible/quality/22945)](https://galaxy.ansible.com/robertdebock/tomcat)|[![downloads](https://img.shields.io/ansible/role/d/22945)](https://galaxy.ansible.com/robertdebock/tomcat)|[![Version](https://img.shields.io/github/release/robertdebock/ansible-role-tomcat.svg)](https://github.com/robertdebock/ansible-role-tomcat/releases/)| +|[![github](https://github.com/robertdebock/ansible-role-tomcat/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-tomcat/actions)|[![gitlab](https://gitlab.com/robertdebock/ansible-role-tomcat/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-tomcat)|[![quality](https://img.shields.io/ansible/quality/)](https://galaxy.ansible.com/robertdebock/tomcat)|[![downloads](https://img.shields.io/ansible/role/d/)](https://galaxy.ansible.com/robertdebock/tomcat)|[![Version](https://img.shields.io/github/release/robertdebock/ansible-role-tomcat.svg)](https://github.com/robertdebock/ansible-role-tomcat/releases/)| ## [Example Playbook](#example-playbook) @@ -209,10 +209,10 @@ The following roles are used to prepare a system. You may choose to prepare your | Requirement | GitHub | GitLab | |-------------|--------|--------| -| [robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap) -| [robertdebock.core_dependencies](https://galaxy.ansible.com/robertdebock/core_dependencies) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-core_dependencies/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-core_dependencies/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-core_dependencies/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-core_dependencies) -| [robertdebock.java](https://galaxy.ansible.com/robertdebock/java) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-java/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-java/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-java/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-java) -| [robertdebock.service](https://galaxy.ansible.com/robertdebock/service) | [![Build Status GitHub](https://github.com/robertdebock/ansible-role-service/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-service/actions) | [![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-ansible-role-service/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-service) +|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-bootstrap)| +|[robertdebock.core_dependencies](https://galaxy.ansible.com/robertdebock/core_dependencies)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-core_dependencies/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-core_dependencies/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-core_dependencies/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-core_dependencies)| +|[robertdebock.java](https://galaxy.ansible.com/robertdebock/java)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-java/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-java/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-java/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-java)| +|[robertdebock.service](https://galaxy.ansible.com/robertdebock/service)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-service/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-service/actions)|[![Build Status GitLab ](https://gitlab.com/robertdebock/ansible-role-service/badges/master/pipeline.svg)](https://gitlab.com/robertdebock/ansible-role-service)| ## [Context](#context) From 8f8971b2317c7aa98950e5927558d7131f2e7c39 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 29 Mar 2021 01:00:13 +0200 Subject: [PATCH 4/5] Start yaml with three dashes. --- .ansible-lint | 1 + 1 file changed, 1 insertion(+) diff --git a/.ansible-lint b/.ansible-lint index a52cd91..b43ccd9 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,3 +1,4 @@ +--- # # Ansible managed # From 14e30dcae7e1e9d4e460397c14c8455edd9b0db0 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Tue, 30 Mar 2021 15:08:01 +0200 Subject: [PATCH 5/5] Collections for molecule ansible code too. --- molecule/default/verify.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index 1df4e80..c4c9f36 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -14,7 +14,7 @@ tasks: - name: install netcat - package: + ansible.builtin.package: name: "{{ netcat_package }}" state: present notify: @@ -24,7 +24,7 @@ shell: nc --listen --keep-open 127.0.0.2 8080 & - name: see if sensitive information is not exposed - uri: + ansible.builtin.uri: url: "http://localhost:8080/" return_content: yes register: this @@ -33,6 +33,6 @@ handlers: - name: uninstall netcat - package: + ansible.builtin.package: name: "{{ netcat_package }}" state: absent