From ea61fc33d2db8b505f65f166d4388857facb66fe Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Mon, 22 May 2023 13:10:58 +0200 Subject: [PATCH] Add filename to taskname, cleanup. --- .ansible-lint | 3 +++ tasks/assert.yml | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index c77bb98..9ede9f9 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -14,3 +14,6 @@ exclude_paths: skip_list: - yaml[truthy] + +enable_list: + - name[prefix] diff --git a/tasks/assert.yml b/tasks/assert.yml index 25d7366..c66dc31 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -1,6 +1,6 @@ --- -- name: Test if fail2ban_loglevel is set correctly +- name: assert | Test if fail2ban_loglevel is set correctly ansible.builtin.assert: that: - fail2ban_loglevel is defined @@ -8,14 +8,14 @@ - fail2ban_loglevel in [ "CRITICAL", "ERROR", "WARNING", "NOTICE", "INFO", "DEBUG" ] quiet: yes -- name: Test if fail2ban_logtarget is set correctly +- name: assert | Test if fail2ban_logtarget is set correctly ansible.builtin.assert: that: - fail2ban_logtarget is defined - fail2ban_logtarget is string quiet: yes -- name: Test if fail2ban_ignoreself is set correctly +- name: assert | Test if fail2ban_ignoreself is set correctly ansible.builtin.assert: that: - fail2ban_ignoreself is defined @@ -23,14 +23,14 @@ - fail2ban_ignoreself in [ "false", "true" ] quiet: yes -- name: Test if fail2ban_ignoreips is set correctly +- name: assert | Test if fail2ban_ignoreips is set correctly ansible.builtin.assert: that: - fail2ban_ignoreips is defined - fail2ban_ignoreips is iterable quiet: yes -- name: Test if fail2ban_bantime is set correctly +- name: assert | Test if fail2ban_bantime is set correctly ansible.builtin.assert: that: - fail2ban_bantime is defined @@ -38,7 +38,7 @@ - fail2ban_bantime >= -1 and fail2ban_bantime !=0 quiet: yes -- name: Test if fail2ban_findtime is set correctly +- name: assert | Test if fail2ban_findtime is set correctly ansible.builtin.assert: that: - fail2ban_findtime is defined @@ -46,7 +46,7 @@ - fail2ban_findtime > 0 quiet: yes -- name: Test if fail2ban_maxretry is set correctly +- name: assert | Test if fail2ban_maxretry is set correctly ansible.builtin.assert: that: - fail2ban_maxretry is defined @@ -54,21 +54,21 @@ - fail2ban_maxretry > 0 quiet: yes -- name: Test if fail2ban_destemail is set correctly +- name: assert | Test if fail2ban_destemail is set correctly ansible.builtin.assert: that: - fail2ban_destemail is defined - fail2ban_destemail is string quiet: yes -- name: Test if fail2ban_sender is set correctly +- name: assert | Test if fail2ban_sender is set correctly ansible.builtin.assert: that: - fail2ban_sender is defined - fail2ban_sender is string quiet: yes -- name: Test if fail2ban_configuration is set correctly +- name: assert | Test if fail2ban_configuration is set correctly ansible.builtin.assert: that: - fail2ban_configuration is iterable @@ -76,7 +76,7 @@ when: - fail2ban_configuration is defined -- name: Test if item in fail2ban_configuration is set correctly +- name: assert | Test if item in fail2ban_configuration is set correctly ansible.builtin.assert: that: - item.option is defined @@ -91,7 +91,7 @@ when: - fail2ban_configuration is defined -- name: Test if fail2ban_jail_configuration is set correctly +- name: assert | Test if fail2ban_jail_configuration is set correctly ansible.builtin.assert: that: - item.option is defined @@ -106,7 +106,7 @@ when: - fail2ban_jail_configuration is defined -- name: Test if item in fail2ban_filterd_path is set correctly +- name: assert | Test if item in fail2ban_filterd_path is set correctly ansible.builtin.assert: that: - fail2ban_filterd_path is string