You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If my DNS entries have regexp, the api_modify module breaks (fails with KeyError while parsing data from the router).
The api module successfully adds it for example:
- name: Add with apidelegate_to: localhostcommunity.routeros.api:
path: ip dns staticadd: 'address=10.1.2.3 regexp=".*\\.ansible\\.test\$"'
api_modify complains about missing "name".
If I comment out satisfy_keys I can at least add the normal A record with a name, although I see regexp is missing from fields. RouterOS requires either name or regexp to be present, I'm not familiar enough with the code to tell if that's possible to check for unfortunately.
This patch seems to fix it for me, I can also add regexp as expected, it does somewhat break check mode since it accepts invalid entries (missing both name and regexp).
- name: Add with api_modifydelegate_to: localhostcommunity.routeros.api_modify:
path: ip dns staticdata:
- address: "10.1.2.3"regexp: '.*\.ansible\.test$'ttl: 1h
SUMMARY
If my DNS entries have regexp, the
api_modify
module breaks (fails with KeyError while parsing data from the router).The
api
module successfully adds it for example:api_modify
complains about missing "name".If I comment out satisfy_keys I can at least add the normal A record with a name, although I see regexp is missing from fields. RouterOS requires either
name
orregexp
to be present, I'm not familiar enough with the code to tell if that's possible to check for unfortunately.ISSUE TYPE
COMPONENT NAME
community.routeros.api_modify
ANSIBLE VERSION
COLLECTION VERSION
OS / ENVIRONMENT
RouterOS 7.6
STEPS TO REPRODUCE
For this to fail, a record without
name
must exist on the router.EXPECTED RESULTS
DNS entry to be added/modified.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: