Skip to content

Commit

Permalink
Change yes/no to true/false, adhere to yamlspec 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-de-bock committed Mar 18, 2024
1 parent f64a6d0 commit 4c03a15
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/requirements2png.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
uses: ad-m/github-push-action@master
with:
directory: ${{ github.repository }}
force: yes
force: true
branch: png
3 changes: 0 additions & 3 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ rules:
line-length: disable
truthy:
check-keys: no
allowed-values:
- "yes"
- "no"

ignore: |
.tox/
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

roles:
- role: ansible-role-fail2ban
4 changes: 2 additions & 2 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Prepare
hosts: all
become: yes
gather_facts: no
become: true
gather_facts: false

roles:
- role: robertdebock.bootstrap
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 13 additions & 13 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,76 +6,76 @@
- 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:
that:
- 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:
that:
- 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:
that:
- 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:
that:
- fail2ban_findtime is defined
- fail2ban_findtime is number
- fail2ban_findtime > 0
quiet: yes
quiet: true

- name: assert | Test fail2ban_maxretry
ansible.builtin.assert:
that:
- fail2ban_maxretry is defined
- fail2ban_maxretry is number
- fail2ban_maxretry > 0
quiet: yes
quiet: true

- name: assert | Test fail2ban_destemail
ansible.builtin.assert:
that:
- 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:
that:
- 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

Expand All @@ -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 }}"
Expand All @@ -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 }}"
Expand All @@ -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
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -68,4 +68,4 @@
ansible.builtin.service:
name: "{{ fail2ban_service }}"
state: started
enabled: yes
enabled: true

0 comments on commit 4c03a15

Please sign in to comment.