Skip to content

Commit

Permalink
Add filename to taskname, cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-de-bock committed May 22, 2023
1 parent f9d6d80 commit ea61fc3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ exclude_paths:

skip_list:
- yaml[truthy]

enable_list:
- name[prefix]
26 changes: 13 additions & 13 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
---

- 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
- fail2ban_loglevel is string
- 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
- fail2ban_ignoreself is string
- 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
- fail2ban_bantime is number
- 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
- fail2ban_findtime is number
- 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
- fail2ban_maxretry is number
- 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
quiet: yes
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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ea61fc3

Please sign in to comment.