-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15a1b8f
commit befce50
Showing
1 changed file
with
123 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |