-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
task288 - add dyndns tasks,test,handler #97
Changes from 2 commits
285dbea
45c9dac
d9cc00a
a0a00d8
e61b1f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
# | ||
#opn_dyndns_general: | ||
Check failure on line 3 in tasks/dyndns.yml GitHub Actions / ansible lintyaml[comments]
|
||
# - key: enabled | ||
# value: "1" | ||
# - key: verbose | ||
# value: "0" | ||
# - key: allowipv6nano | ||
Check failure on line 8 in tasks/dyndns.yml GitHub Actions / ansible lintyaml[trailing-spaces]
|
||
# value: "0" | ||
# - key: daemon_delay | ||
# value: "300" | ||
# - key: backend | ||
# value: "opnsense" | ||
#opn_dyndns_accounts: | ||
Check failure on line 14 in tasks/dyndns.yml GitHub Actions / ansible lintyaml[comments]
|
||
# - uuid: "8e4627c4-21ff-4252-a331-3d1adee0a023" | ||
# settings: | ||
# - key: enabled | ||
# value: "1" | ||
# - key: service | ||
# value: "testservice" | ||
# - key: protocol | ||
# value: "" | ||
# - key: server | ||
# value: "" | ||
# - key: username | ||
# value: "user" | ||
# - key: password | ||
# value: "pass" | ||
# - key: resourceId | ||
# value: "" | ||
# - key: hostnames | ||
# value: "all.ddnskey.com" | ||
# - key: wildcard | ||
# value: "0" | ||
# - key: zone | ||
# value: "" | ||
# - key: checkip | ||
# value: "web_noip-ipv4" | ||
# - key: checkip_timeout | ||
# value: "10" | ||
# - key: force_ssl | ||
# value: "1" | ||
# - key: ttl | ||
# value: "300" | ||
# - key: interface | ||
# value: "wan" | ||
# - key: description | ||
# value: "dyndns-description" | ||
Check failure on line 48 in tasks/dyndns.yml GitHub Actions / ansible lintyaml[trailing-spaces]
|
||
|
||
- name: DynDNS - Update general DynDNS settings | ||
delegate_to: localhost | ||
community.general.xml: | ||
path: "{{ local_config_path }}" | ||
xpath: "/opnsense/OPNsense/DynDNS/general/{{ item.key }}" | ||
value: "{{ item.value }}" | ||
state: present | ||
pretty_print: true | ||
notify: restart dyndns | ||
loop: "{{ opn_dyndns_general }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and I would prefer to use `with_items' here |
||
when: | ||
- opn_dyndns_general is defined | ||
|
||
- name: DynDNS - Apply settings for each DynDNS account | ||
delegate_to: localhost | ||
community.general.xml: | ||
path: "{{ local_config_path }}" | ||
xpath: "/opnsense/OPNsense/DynDNS/accounts/account[@uuid='{{ item.0.uuid }}']/{{ item.1.key }}" | ||
value: "{{ item.1.value }}" | ||
state: present | ||
pretty_print: true | ||
notify: restart dyndns | ||
with_subelements: | ||
- "{{ opn_dyndns_accounts }}" | ||
- settings | ||
when: | ||
- opn_dyndns_accounts_ng is defined | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. - - opn_dyndns_accounts_ng is defined
+ - opn_dyndns_accounts is defined |
||
- item.1.key != 'enable' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. - - item.1.key != 'enable' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<opnsense> | ||
</opnsense> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
test_name: simple filter test | ||
|
||
opn_dyndns_general: | ||
- key: enabled | ||
value: "1" | ||
- key: verbose | ||
value: "0" | ||
- key: allowipv6nano | ||
value: "0" | ||
- key: daemon_delay | ||
value: "300" | ||
- key: backend | ||
value: "opnsense" | ||
opn_dyndns_accounts: | ||
- uuid: "8e4627c4-21ff-4252-a331-3d1adee0a023" | ||
settings: | ||
- key: enabled | ||
value: "1" | ||
- key: service | ||
value: "noip" | ||
- key: protocol | ||
value: "" | ||
- key: server | ||
value: "" | ||
- key: username | ||
value: "" | ||
- key: password | ||
value: "user" | ||
- key: resourceId | ||
value: "pass" | ||
- key: hostnames | ||
value: "all.ddnskey.com" | ||
- key: wildcard | ||
value: "0" | ||
- key: zone | ||
value: "" | ||
- key: checkip | ||
value: "web_noip-ipv4" | ||
- key: checkip_timeout | ||
value: "10" | ||
- key: force_ssl | ||
value: "1" | ||
- key: ttl | ||
value: "300" | ||
- key: interface | ||
value: "wan" | ||
- key: description | ||
value: "dyndns-description" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,10 @@ | |
- name: stop ipsec # TODO: test this action; use community.general.xml and add a tag to the resulting xml | ||
debug: | ||
msg: fake handler - stop ipsec | ||
- name: restart dyndns | ||
debug: | ||
msg: fake handler - restart dyndns | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pls, do not add empty lines where there was none was before ... |
||
tasks: | ||
- name: include default vars | ||
ansible.builtin.include_vars: | ||
|
@@ -44,6 +48,7 @@ | |
- ipsec | ||
- dnsserver | ||
- openvpn | ||
- dyndns | ||
when: | ||
- test | default(_testtask) == _testtask | ||
- ansible.builtin.meta: flush_handlers | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls fix the lint errors first ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the new dyndns-test should work pls