Skip to content
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

Add "handle_stratified" support #160

Closed

Conversation

phox142
Copy link
Contributor

@phox142 phox142 commented Mar 14, 2023

SUMMARY

The goal of this change is to permit to handle_absent_entries=remove and ensure_order=True to work on subset based on stratify_keys
For instance if the parameter handle_stratified is set to True when working on firewall rules, only the rules in the same chain will be affected. The other chains will not be adapted.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

api module

@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Merging #160 (0aaa34e) into main (071f742) will increase coverage by 0.69%.
The diff coverage is 98.35%.

@@            Coverage Diff             @@
##             main     #160      +/-   ##
==========================================
+ Coverage   86.47%   87.17%   +0.69%     
==========================================
  Files          30       30              
  Lines        3690     3868     +178     
  Branches      673      559     -114     
==========================================
+ Hits         3191     3372     +181     
+ Misses        362      359       -3     
  Partials      137      137              
Flag Coverage Δ
integration 66.86% <ø> (ø)
sanity 21.95% <0.00%> (-0.04%) ⬇️
units 87.22% <98.35%> (+0.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
plugins/modules/api_modify.py 78.93% <25.00%> (+0.58%) ⬆️
tests/unit/plugins/modules/test_api_modify.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link

github-actions bot commented Mar 14, 2023

Docs Build 📝

This PR is closed and any previously published docsite has been unpublished.

description:
- TODO
type: bool
default: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about instead allowing to specify which keys (for stratification) to consider, so that only entries for these keys are accepted by the module and that only entries for these keys are considered?

@irrwitzer42
Copy link

@phox142 Thanks so much for implementing this! Looking forward to seeing this merged soon!

My use case are address lists - I have common ones on every router and I have router specific ones. At the moment, the specific ones would be removed on every playbook run.

Thanks again!

@ewysong
Copy link

ewysong commented Jun 25, 2024

Any progress on this? Being able to manage address-lists with idempotence would be a big benefit.

@felixfontein
Copy link
Collaborator

I created another PR with a more flexible approach (basically what I mentioning in https://github.com/ansible-collections/community.routeros/pull/160/files/0aaa34e0d71af860c83c379e9dcbd9bb338c863d#diff-b46a57970bad777c71fc3d869bef8246fd76e6ec947fb99012b34d1f0f78b130) in #305.

@ewysong
Copy link

ewysong commented Aug 12, 2024

@felixfontein awesome! Looking forward to it being merged 😃

@felixfontein
Copy link
Collaborator

@phox142 thanks for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants