Skip to content

Commit

Permalink
Correction and Bugfix for ip dhcp-server network (#156)
Browse files Browse the repository at this point in the history
* API_DATA > ('ip', 'dhcp-server', 'network') > netmask
replace "automatically_computed_from" by 'can_disable=True, remove_value=0'
automatically_computed_from does not seem to be used at any place in the code
without 'can_disable=True, remove_value=0' task is marked as changed at each execution.

* API_DATA > ('ip', 'dhcp-server', 'network') > next-server
replace "default=''" by 'can_disable=True'
The default in routeros is "no value" and it was not possible to remove a configured next-server

* API_DATA > ('ip', 'dhcp-server', 'network') > gateway
replace "automatically_computed_from" by "default=''"
automatically_computed_from does not seem to be used

* API_DATA > ('ip', 'dhcp-server', 'network') > dns-none
replace "default=''" by "default=False"

* Add changelogs fragment

* Update changelogs/fragments/156-ip_dhcp-server_network.yml

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
  • Loading branch information
phox142 and felixfontein authored Mar 10, 2023
1 parent ab87a27 commit 4d86ba1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/156-ip_dhcp-server_network.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- api_modify - adapt data for API paths ``ip dhcp-server network`` (https://github.com/ansible-collections/community.routeros/pull/156).
8 changes: 4 additions & 4 deletions plugins/module_utils/_api_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,12 +1356,12 @@ def join_path(path):
'comment': KeyInfo(can_disable=True, remove_value=''),
'dhcp-option': KeyInfo(default=''),
'dhcp-option-set': KeyInfo(default=''),
'dns-none': KeyInfo(default=''),
'dns-none': KeyInfo(default=False),
'dns-server': KeyInfo(default=''),
'domain': KeyInfo(default=''),
'gateway': KeyInfo(automatically_computed_from=('address', )),
'netmask': KeyInfo(automatically_computed_from=('address', )),
'next-server': KeyInfo(default=''),
'gateway': KeyInfo(default=''),
'netmask': KeyInfo(can_disable=True, remove_value=0),
'next-server': KeyInfo(can_disable=True),
'ntp-server': KeyInfo(default=''),
'wins-server': KeyInfo(default=''),
},
Expand Down

0 comments on commit 4d86ba1

Please sign in to comment.