mirror of
https://github.com/ansible-collections/community.routeros.git
synced 2025-06-28 20:40:24 +02:00
Add IPv4 DHCP option matcher, minor fixes (#300)
* Fix typos in comment on IPsec policy "template" field * Move IPv4 DHCP server API data next to other DHCP APIs * Set default for "force" field on DHCP options Without the default value removing it from the options after it's been set once leads to an error: > Key "force" cannot be removed for name="…" * Add IPv4 DHCP option matcher RouterOS 7.4 and newer implement matchers for the Vendor ID provided by DHCP clients. RouterOS 7.16 will add a new `matching-type` property, but it's not in a stable release yet. Upstream documentation: https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-Genericmatcher
This commit is contained in:
parent
5ee2af49b8
commit
8c62d46198
5 changed files with 57 additions and 33 deletions
2
changelogs/fragments/300-add-ip-dhcp-server-matcher.yml
Normal file
2
changelogs/fragments/300-add-ip-dhcp-server-matcher.yml
Normal file
|
@ -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).
|
|
@ -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).
|
|
@ -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(
|
('routing', 'filter'): APIData(
|
||||||
versioned=[
|
versioned=[
|
||||||
('7', '<', VersionedAPIData(
|
('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(
|
('ip', 'dhcp-server', 'config'): APIData(
|
||||||
unversioned=VersionedAPIData(
|
unversioned=VersionedAPIData(
|
||||||
single_value=True,
|
single_value=True,
|
||||||
|
@ -2738,7 +2738,7 @@ PATHS = {
|
||||||
'code': KeyInfo(required=True),
|
'code': KeyInfo(required=True),
|
||||||
'name': KeyInfo(),
|
'name': KeyInfo(),
|
||||||
'value': KeyInfo(default=''),
|
'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(
|
('ip', 'dns'): APIData(
|
||||||
unversioned=VersionedAPIData(
|
unversioned=VersionedAPIData(
|
||||||
single_value=True,
|
single_value=True,
|
||||||
|
@ -4966,9 +4983,10 @@ PATHS = {
|
||||||
'protocol': KeyInfo(default='all'),
|
'protocol': KeyInfo(default='all'),
|
||||||
'src-address': KeyInfo(),
|
'src-address': KeyInfo(),
|
||||||
'src-port': KeyInfo(default='any'),
|
'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),
|
'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),
|
'tunnel': KeyInfo(default=False),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
@ -125,6 +125,7 @@ options:
|
||||||
- ip dhcp-server
|
- ip dhcp-server
|
||||||
- ip dhcp-server config
|
- ip dhcp-server config
|
||||||
- ip dhcp-server lease
|
- ip dhcp-server lease
|
||||||
|
- ip dhcp-server matcher
|
||||||
- ip dhcp-server network
|
- ip dhcp-server network
|
||||||
- ip dhcp-server option
|
- ip dhcp-server option
|
||||||
- ip dhcp-server option sets
|
- ip dhcp-server option sets
|
||||||
|
|
|
@ -134,6 +134,7 @@ options:
|
||||||
- ip dhcp-server
|
- ip dhcp-server
|
||||||
- ip dhcp-server config
|
- ip dhcp-server config
|
||||||
- ip dhcp-server lease
|
- ip dhcp-server lease
|
||||||
|
- ip dhcp-server matcher
|
||||||
- ip dhcp-server network
|
- ip dhcp-server network
|
||||||
- ip dhcp-server option
|
- ip dhcp-server option
|
||||||
- ip dhcp-server option sets
|
- ip dhcp-server option sets
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue