-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
task #38 - generic unboundplus cfg with sections and uuid-subsections
- Loading branch information
Showing
3 changed files
with
56 additions
and
233 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
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,36 +1,31 @@ | ||
# vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2 smartindent nu ft=yaml | ||
--- | ||
|
||
# example definition: | ||
# | ||
# opn_unboundplus: | ||
# dnsbl: | ||
# enabled: 1 | ||
# type: "aa,ag,bla0,bla" | ||
# whitelists: "*.example.com,*.another.xyz" | ||
# dots: DNSoverTLS is NOT YET IMPLEMENTED! | ||
# miscellaneous: | ||
# privatedomain: "..." | ||
# insecuredomain: "..." | ||
# handle different unboundlus sections | ||
|
||
- name: unboundplus dnsbl | ||
- name: unboundplus settings {{ unboundplussection }} | ||
delegate_to: localhost | ||
community.general.xml: | ||
path: "{{ local_config_path }}" | ||
xpath: "/opnsense/OPNsense/unboundplus/dnsbl/{{ item.key }}" | ||
xpath: "/opnsense/OPNsense/unboundplus/{{ unboundplussection }}/{{ item.key }}" | ||
value: "{{ item.value }}" | ||
pretty_print: true | ||
with_dict: "{{ opn_unboundplus.dnsbl }}" | ||
when: opn_unboundplus.dnsbl is defined | ||
register: _unbound_settings | ||
with_dict: "{{ unboundplussectionsettings }}" | ||
when: | ||
- unboundplussectionsettings is defined | ||
- unboundplussection not in opn_unboundplus_uuid_sections.keys() | ||
|
||
- name: unboundplus miscellaneous | ||
delegate_to: localhost | ||
community.general.xml: | ||
path: "{{ local_config_path }}" | ||
xpath: "/opnsense/OPNsense/unboundplus/miscellaneous/{{ item.key }}" | ||
value: "{{ item.value }}" | ||
pretty_print: true | ||
with_dict: "{{ opn_unboundplus.miscellaneous }}" | ||
when: opn_unboundplus.miscellaneous is defined | ||
- name: unboundplus uuid settings for {{ unboundplussection }} | ||
ansible.builtin.include_tasks: unboundplusuuid.yml | ||
vars: | ||
_uuid: "{{ _opnunbndsettingsuuid.key }}" | ||
_uuidvalues: "{{ _opnunbndsettingsuuid.value }}" | ||
with_dict: "{{ unboundplussectionsettings }}" | ||
loop_control: | ||
loop_var: _opnunbndsettingsuuid | ||
when: | ||
- unboundplussectionsettings is defined | ||
- unboundplussection in opn_unboundplus_uuid_sections.keys() | ||
|
||
... |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
|
||
- name: unboundplus settings {{ unboundplussection }} | ||
delegate_to: localhost | ||
community.general.xml: | ||
path: "{{ local_config_path }}" | ||
xpath: "/opnsense/OPNsense/unboundplus/{{ unboundplussection }}/{{ opn_unboundplus_uuid_sections[unboundplussection] }}[@uuid='{{ _uuid }}']/{{ item.key }}" | ||
value: "{{ item.value }}" | ||
pretty_print: true | ||
register: _unbound_settings_uuid | ||
with_dict: "{{ _uuidvalues }}" | ||
|
||
|
||
... |