diff --git a/changelogs/fragments/300-add-ip-dhcp-server-matcher.yml b/changelogs/fragments/300-add-ip-dhcp-server-matcher.yml new file mode 100644 index 0000000..cf97e06 --- /dev/null +++ b/changelogs/fragments/300-add-ip-dhcp-server-matcher.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add support for the ``ip dhcp-server matcher`` path (https://github.com/ansible-collections/community.routeros/issues/300). diff --git a/changelogs/fragments/300-set-ip-dhcp-option-force-default.yml b/changelogs/fragments/300-set-ip-dhcp-option-force-default.yml new file mode 100644 index 0000000..5158fc3 --- /dev/null +++ b/changelogs/fragments/300-set-ip-dhcp-option-force-default.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - set default for ``force`` in ``ip dhcp-server option`` to an explicit ``false`` (https://github.com/ansible-collections/community.routeros/issues/300). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 061846f..218b379 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -774,36 +774,6 @@ PATHS = { )), ], ), - ('ip', 'dhcp-server'): APIData( - unversioned=VersionedAPIData( - fully_understood=True, - primary_keys=('name', ), - fields={ - 'address-pool': KeyInfo(default='static-only'), - 'allow-dual-stack-queue': KeyInfo(can_disable=True, remove_value=True), - 'always-broadcast': KeyInfo(can_disable=True, remove_value=False), - 'authoritative': KeyInfo(default=True), - 'bootp-lease-time': KeyInfo(default='forever'), - 'bootp-support': KeyInfo(can_disable=True, remove_value='static'), - 'client-mac-limit': KeyInfo(can_disable=True, remove_value='unlimited'), - 'comment': KeyInfo(can_disable=True, remove_value=''), - 'conflict-detection': KeyInfo(can_disable=True, remove_value=True), - 'delay-threshold': KeyInfo(can_disable=True, remove_value='none'), - 'dhcp-option-set': KeyInfo(can_disable=True, remove_value='none'), - 'disabled': KeyInfo(default=False), - 'insert-queue-before': KeyInfo(can_disable=True, remove_value='first'), - 'interface': KeyInfo(required=True), - 'lease-script': KeyInfo(default=''), - 'lease-time': KeyInfo(default='10m'), - 'name': KeyInfo(), - 'parent-queue': KeyInfo(can_disable=True, remove_value='none'), - 'relay': KeyInfo(can_disable=True, remove_value='0.0.0.0'), - 'server-address': KeyInfo(can_disable=True, remove_value='0.0.0.0'), - 'use-framed-as-classless': KeyInfo(can_disable=True, remove_value=True), - 'use-radius': KeyInfo(default=False), - }, - ), - ), ('routing', 'filter'): APIData( versioned=[ ('7', '<', VersionedAPIData( @@ -2679,6 +2649,36 @@ PATHS = { }, ), ), + ('ip', 'dhcp-server'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'address-pool': KeyInfo(default='static-only'), + 'allow-dual-stack-queue': KeyInfo(can_disable=True, remove_value=True), + 'always-broadcast': KeyInfo(can_disable=True, remove_value=False), + 'authoritative': KeyInfo(default=True), + 'bootp-lease-time': KeyInfo(default='forever'), + 'bootp-support': KeyInfo(can_disable=True, remove_value='static'), + 'client-mac-limit': KeyInfo(can_disable=True, remove_value='unlimited'), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'conflict-detection': KeyInfo(can_disable=True, remove_value=True), + 'delay-threshold': KeyInfo(can_disable=True, remove_value='none'), + 'dhcp-option-set': KeyInfo(can_disable=True, remove_value='none'), + 'disabled': KeyInfo(default=False), + 'insert-queue-before': KeyInfo(can_disable=True, remove_value='first'), + 'interface': KeyInfo(required=True), + 'lease-script': KeyInfo(default=''), + 'lease-time': KeyInfo(default='10m'), + 'name': KeyInfo(), + 'parent-queue': KeyInfo(can_disable=True, remove_value='none'), + 'relay': KeyInfo(can_disable=True, remove_value='0.0.0.0'), + 'server-address': KeyInfo(can_disable=True, remove_value='0.0.0.0'), + 'use-framed-as-classless': KeyInfo(can_disable=True, remove_value=True), + 'use-radius': KeyInfo(default=False), + }, + ), + ), ('ip', 'dhcp-server', 'config'): APIData( unversioned=VersionedAPIData( single_value=True, @@ -2738,7 +2738,7 @@ PATHS = { 'code': KeyInfo(required=True), 'name': KeyInfo(), 'value': KeyInfo(default=''), - 'force': KeyInfo(), + 'force': KeyInfo(default=False), }, ), ), @@ -2752,6 +2752,23 @@ PATHS = { }, ), ), + ('ip', 'dhcp-server', 'matcher'): APIData( + versioned=[ + ('7.4', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'address-pool': KeyInfo(default='none'), + 'code': KeyInfo(required=True), + 'disabled': KeyInfo(default=False), + 'name': KeyInfo(required=True), + 'option-set': KeyInfo(), + 'server': KeyInfo(default='all'), + 'value': KeyInfo(required=True), + }, + )), + ], + ), ('ip', 'dns'): APIData( unversioned=VersionedAPIData( single_value=True, @@ -4966,9 +4983,10 @@ PATHS = { 'protocol': KeyInfo(default='all'), 'src-address': KeyInfo(), 'src-port': KeyInfo(default='any'), + # The template field can't really be changed once the item is + # created. This config captures the behavior best as it can + # i.e. template=yes is shown, template=no is hidden. 'template': KeyInfo(can_disable=True, remove_value=False), - # the tepmlate field can't really be changed once the item is created. This config captures the behavior best as it can - # i.e. tepmplate=yes is shown, tepmlate=no is hidden 'tunnel': KeyInfo(default=False), }, ), diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index e8d8663..7f45ef5 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -125,6 +125,7 @@ options: - ip dhcp-server - ip dhcp-server config - ip dhcp-server lease + - ip dhcp-server matcher - ip dhcp-server network - ip dhcp-server option - ip dhcp-server option sets diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 5cb1cd8..eb06566 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -134,6 +134,7 @@ options: - ip dhcp-server - ip dhcp-server config - ip dhcp-server lease + - ip dhcp-server matcher - ip dhcp-server network - ip dhcp-server option - ip dhcp-server option sets