From 4c03a156e771ee14043225f61e6aab5044862d78 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 18 Mar 2024 10:18:32 +0100 Subject: [PATCH] Change yes/no to true/false, adhere to yamlspec 1.2.2 --- .github/workflows/requirements2png.yml | 2 +- .yamllint | 3 --- README.md | 8 ++++---- molecule/default/converge.yml | 4 ++-- molecule/default/prepare.yml | 4 ++-- molecule/default/verify.yml | 4 ++-- tasks/assert.yml | 26 +++++++++++++------------- tasks/main.yml | 4 ++-- 8 files changed, 26 insertions(+), 29 deletions(-) diff --git a/.github/workflows/requirements2png.yml b/.github/workflows/requirements2png.yml index a132e12..f12e0c3 100644 --- a/.github/workflows/requirements2png.yml +++ b/.github/workflows/requirements2png.yml @@ -31,5 +31,5 @@ jobs: uses: ad-m/github-push-action@master with: directory: ${{ github.repository }} - force: yes + force: true branch: png diff --git a/.yamllint b/.yamllint index 10d5946..cc50726 100644 --- a/.yamllint +++ b/.yamllint @@ -11,9 +11,6 @@ rules: line-length: disable truthy: check-keys: no - allowed-values: - - "yes" - - "no" ignore: | .tox/ diff --git a/README.md b/README.md index fdfc67e..ec0a3b8 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ This example is taken from [`molecule/default/converge.yml`](https://github.com/ --- - name: Converge hosts: all - become: yes - gather_facts: yes + become: true + gather_facts: true roles: - role: robertdebock.fail2ban @@ -27,8 +27,8 @@ The machine needs to be prepared. In CI this is done using [`molecule/default/pr --- - name: Prepare hosts: all - become: yes - gather_facts: no + become: true + gather_facts: false roles: - role: robertdebock.bootstrap diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 3194da6..f32beae 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -1,8 +1,8 @@ --- - name: Converge hosts: all - become: yes - gather_facts: yes + become: true + gather_facts: true roles: - role: ansible-role-fail2ban diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml index dbdd6d8..770e352 100644 --- a/molecule/default/prepare.yml +++ b/molecule/default/prepare.yml @@ -1,8 +1,8 @@ --- - name: Prepare hosts: all - become: yes - gather_facts: no + become: true + gather_facts: false roles: - role: robertdebock.bootstrap diff --git a/molecule/default/verify.yml b/molecule/default/verify.yml index 6b7f3b8..206e085 100644 --- a/molecule/default/verify.yml +++ b/molecule/default/verify.yml @@ -1,8 +1,8 @@ --- - name: Verify hosts: all - become: yes - gather_facts: no + become: true + gather_facts: false tasks: - name: Check if connection still works diff --git a/tasks/assert.yml b/tasks/assert.yml index af69843..96210fa 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -6,7 +6,7 @@ - fail2ban_loglevel is defined - fail2ban_loglevel is string - fail2ban_loglevel in [ "CRITICAL", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG" ] - quiet: yes + quiet: true - name: assert | Test fail2ban_logtarget ansible.builtin.assert: @@ -14,7 +14,7 @@ - fail2ban_logtarget is defined - fail2ban_logtarget is string - fail2ban_logtarget is not none - quiet: yes + quiet: true - name: assert | Test fail2ban_ignoreself ansible.builtin.assert: @@ -22,14 +22,14 @@ - fail2ban_ignoreself is defined - fail2ban_ignoreself is string - fail2ban_ignoreself in [ "false", "true" ] - quiet: yes + quiet: true - name: assert | Test fail2ban_ignoreips ansible.builtin.assert: that: - fail2ban_ignoreips is defined - fail2ban_ignoreips is iterable - quiet: yes + quiet: true - name: assert | Test fail2ban_bantime ansible.builtin.assert: @@ -37,7 +37,7 @@ - fail2ban_bantime is defined - fail2ban_bantime is number - fail2ban_bantime >= -1 and fail2ban_bantime !=0 - quiet: yes + quiet: true - name: assert | Test fail2ban_findtime ansible.builtin.assert: @@ -45,7 +45,7 @@ - fail2ban_findtime is defined - fail2ban_findtime is number - fail2ban_findtime > 0 - quiet: yes + quiet: true - name: assert | Test fail2ban_maxretry ansible.builtin.assert: @@ -53,7 +53,7 @@ - fail2ban_maxretry is defined - fail2ban_maxretry is number - fail2ban_maxretry > 0 - quiet: yes + quiet: true - name: assert | Test fail2ban_destemail ansible.builtin.assert: @@ -61,7 +61,7 @@ - fail2ban_destemail is defined - fail2ban_destemail is string - fail2ban_destemail is not none - quiet: yes + quiet: true - name: assert | Test fail2ban_sender ansible.builtin.assert: @@ -69,13 +69,13 @@ - fail2ban_sender is defined - fail2ban_sender is string - fail2ban_sender is not none - quiet: yes + quiet: true - name: assert | Test fail2ban_configuration ansible.builtin.assert: that: - fail2ban_configuration is iterable - quiet: yes + quiet: true when: - fail2ban_configuration is defined @@ -89,7 +89,7 @@ - item.section is defined - item.section is string - item.section is not none - quiet: yes + quiet: true loop: "{{ fail2ban_configuration }}" loop_control: label: "{{ item.option }}" @@ -106,7 +106,7 @@ - item.section is defined - item.section is string - item.section is not none - quiet: yes + quiet: true loop: "{{ fail2ban_jail_configuration }}" loop_control: label: "{{ item.option }}" @@ -118,6 +118,6 @@ that: - fail2ban_filterd_path is string - fail2ban_filterd_path is not none - quiet: yes + quiet: true when: - fail2ban_filterd_path is defined diff --git a/tasks/main.yml b/tasks/main.yml index 78a7f55..afc31b2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,7 +4,7 @@ - name: Import assert.yml ansible.builtin.import_tasks: file: assert.yml - run_once: yes + run_once: true delegate_to: localhost - name: Install fail2ban @@ -68,4 +68,4 @@ ansible.builtin.service: name: "{{ fail2ban_service }}" state: started - enabled: yes + enabled: true