Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Oct 25, 2024
1 parent 15a1b8f commit befce50
Showing 1 changed file with 123 additions and 123 deletions.
246 changes: 123 additions & 123 deletions tests/unbound_dnsbl.yml
Original file line number Diff line number Diff line change
@@ -1,123 +1,123 @@
---

- name: Testing Unbound DNS general settings
hosts: localhost
gather_facts: no
module_defaults:
group/ansibleguy.opnsense.all:
firewall: "{{ lookup('ansible.builtin.env', 'TEST_FIREWALL') }}"
api_credential_file: "{{ lookup('ansible.builtin.env', 'TEST_API_KEY') }}"
ssl_verify: false

ansibleguy.opnsense.list:
target: 'unbound_dnsbl'

tasks:
- name: Listing
ansibleguy.opnsense.list:
register: opn_pre1
failed_when: >
opn_pre1.failed or
'data' not in opn_pre1
- name: Configuring - failing because of invalid type
ansibleguy.opnsense.unbound_dnsbl:
type:
- ANSIBLE_TEST_1
register: opn_fail1
failed_when: not opn_fail1.failed
when: not ansible_check_mode

- name: Configuring - failing because of invalid address
ansibleguy.opnsense.unbound_dnsbl:
address: INVALID
register: opn_fail2
failed_when: not opn_fail2.failed
when: not ansible_check_mode

- name: Reset Configuring
ansibleguy.opnsense.unbound_dnsbl:
when: not ansible_check_mode

- name: Configuring
ansibleguy.opnsense.unbound_dnsbl:
type:
- atf
lists: ['https://example.com/dns.blocklist']
whitelists:
- opnsense.org
- ansibleguy.net
blocklists:
- example.tor
wildcards:
- example.tor
address: 192.168.255.255
nxdomain: false
enabled: true
register: opn1
failed_when: >
opn1.failed or
not opn1.changed
- name: Changing
ansibleguy.opnsense.unbound_dnsbl:
type:
- atf
whitelists:
- opnsense.org
- ansibleguy.net
blocklists:
- example.tor
wildcards:
- example.tor
nxdomain: true
enabled: true
register: opn2
failed_when: >
opn2.failed or
not opn2.changed
- name: Disabling 1
ansibleguy.opnsense.unbound_dnsbl:
type:
- atf
whitelists:
- opnsense.org
- ansibleguy.net
blocklists:
- example.tor
wildcards:
- example.tor
nxdomain: true
enabled: false
reload: false # speed
register: opn3
failed_when: >
opn3.failed or
not opn3.changed
when: not ansible_check_mode

- name: Nothing changed
ansibleguy.opnsense.unbound_dnsbl:
type:
- atf
whitelists:
- opnsense.org
- ansibleguy.net
blocklists:
- example.tor
wildcards:
- example.tor
nxdomain: true
enabled: false
reload: false # speed
register: opn4
failed_when: >
opn4.failed or
opn4.changed
when: not ansible_check_mode

- name: Cleanup
ansibleguy.opnsense.unbound_dnsbl:
reload: false
when: not ansible_check_mode
---

- name: Testing Unbound DNS general settings
hosts: localhost
gather_facts: no
module_defaults:
group/ansibleguy.opnsense.all:
firewall: "{{ lookup('ansible.builtin.env', 'TEST_FIREWALL') }}"
api_credential_file: "{{ lookup('ansible.builtin.env', 'TEST_API_KEY') }}"
ssl_verify: false

ansibleguy.opnsense.list:
target: 'unbound_dnsbl'

tasks:
- name: Listing
ansibleguy.opnsense.list:
register: opn_pre1
failed_when: >
opn_pre1.failed or
'data' not in opn_pre1
- name: Configuring - failing because of invalid type
ansibleguy.opnsense.unbound_dnsbl:
type:
- ANSIBLE_TEST_1
register: opn_fail1
failed_when: not opn_fail1.failed
when: not ansible_check_mode

- name: Configuring - failing because of invalid address
ansibleguy.opnsense.unbound_dnsbl:
address: INVALID
register: opn_fail2
failed_when: not opn_fail2.failed
when: not ansible_check_mode

- name: Reset Configuring
ansibleguy.opnsense.unbound_dnsbl:
when: not ansible_check_mode

- name: Configuring
ansibleguy.opnsense.unbound_dnsbl:
type:
- atf
lists: ['https://example.com/dns.blocklist']
whitelists:
- opnsense.org
- ansibleguy.net
blocklists:
- example.tor
wildcards:
- example.tor
address: 192.168.255.255
nxdomain: false
enabled: true
register: opn1
failed_when: >
opn1.failed or
not opn1.changed
- name: Changing
ansibleguy.opnsense.unbound_dnsbl:
type:
- atf
whitelists:
- opnsense.org
- ansibleguy.net
blocklists:
- example.tor
wildcards:
- example.tor
nxdomain: true
enabled: true
register: opn2
failed_when: >
opn2.failed or
not opn2.changed
- name: Disabling 1
ansibleguy.opnsense.unbound_dnsbl:
type:
- atf
whitelists:
- opnsense.org
- ansibleguy.net
blocklists:
- example.tor
wildcards:
- example.tor
nxdomain: true
enabled: false
reload: false # speed
register: opn3
failed_when: >
opn3.failed or
not opn3.changed
when: not ansible_check_mode

- name: Nothing changed
ansibleguy.opnsense.unbound_dnsbl:
type:
- atf
whitelists:
- opnsense.org
- ansibleguy.net
blocklists:
- example.tor
wildcards:
- example.tor
nxdomain: true
enabled: false
reload: false # speed
register: opn4
failed_when: >
opn4.failed or
opn4.changed
when: not ansible_check_mode

- name: Cleanup
ansibleguy.opnsense.unbound_dnsbl:
reload: false
when: not ansible_check_mode

0 comments on commit befce50

Please sign in to comment.