-
Notifications
You must be signed in to change notification settings - Fork 49
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
Changed primary key of 'tool netwatch' #247
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #247 +/- ##
=======================================
Coverage 82.97% 82.97%
=======================================
Files 32 32
Lines 4046 4046
Branches 871 871
=======================================
Hits 3357 3357
Misses 506 506
Partials 183 183
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This was added by @hansmi in #216. Also please note that any change must come with a changelog fragment. |
I think this is a bit trickier than it appears at first. Setting the primary key to the
Nevertheless I see that As the |
I see. I've mistakenly interpreted the output and concluded that the When using the following task:
Results in the following error;
|
@tim427 Which version of RouterOS are you running? Not that I currently have evidence but only a suspicion. Could you please verify that you actually can use the I am running RouterOS version 7.13 currently (most recent) and having the following created via Ansible works fine.
|
Version: 7.13rc4 Tab completion:
By simply executing
So |
Same results for version: 7.14beta4
|
Unfortunately I am unable to reproduce this on the fly. Later on I will spawn a VM with RouterOS 7.14beta4 and try to provoke and reproduce this error. |
|
Interesting... This version actually works... 7.13
So it was broken in the latest ReleaseCandiate (7.13rc4), it works on the stable version (7.13) and is again broken on the new testing channel (7.14beta4). |
Also; the whole So |
I found something interesting: With the following config:
And already some netwatch entries in place on the RouterOS without To conclude, it's exactly the otherway around: Solution: remove everywhere the old Would it be wise to make a "default" for the |
I just spawned a VM with RouterOS version 7.14beta4 and did some parallel testing with 7.13. It just got a bit more complicated as even the primary key set to the Below is the output of
IMHO we should dig deeper here and find a suitable general approach.
Good catch! |
plugins/module_utils/_api_data.py
Outdated
@@ -3652,7 +3652,7 @@ def join_path(path): | |||
versioned=[ | |||
('7', '>=', VersionedAPIData( | |||
fully_understood=True, | |||
primary_keys=('name', ), | |||
primary_keys=('host', ), |
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.
You could also simply use
primary_keys=('host', ), |
Then the module doesn't use any kind of identifier. (You should best use such a path with handle_absent_entries=remove
and handle_entries_content=remove_as_much_as_possible
. Otherwise you don't modify entries, but only add new ones...)
This still needs a changelog fragment before it can be merged :) |
Docs Build 📝Thank you for contribution!✨ This PR has been merged and the docs are now incorporated into |
@tim427 @derdeagle thanks a lot! |
SUMMARY
I've changed the primary key for
tool netwatch
fromname
tohost
, becausename
isn't used at all.ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
When adding
name
to the playbook:When removing the
name
: