-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
zypper_repository: extend module with possibility to modify repos #8795
base: main
Are you sure you want to change the base?
zypper_repository: extend module with possibility to modify repos #8795
Conversation
bdf0dd3
to
3931bf5
Compare
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.
Thanks for your contribution!
type: str | ||
state: | ||
action: |
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.
Please note that module options such as action
are not a good idea (https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_best_practices.html#designing-module-interfaces), in particular if state
is already present.
All your actions should already be doable with state
. Modifying should be done with state=present
and passing other parameters.
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.
I hear you, but state
with [ "absent", "present" ]
is only relevant when using add
or remove
, but it's irrelevant when using action
with [ "modify" ]
. When I modify
a repo I expect it to be present
.
Introducing action
was IMHO the only possibility to add feature: modify
.
If you have a better idea, I am open to hear ...
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.
No, state=present
usually also means modify (except in certain situations, like it hasn't been implemented yet).
Please remove the action
option and change the code so that with state=present
it creates (if it doesn't exist yet) or modifies (if it does exist and is changed).
3931bf5
to
5171eed
Compare
5171eed
to
1c7dae1
Compare
@computersalat ping needs_info |
@computersalat This pullrequest is waiting for your response. Please respond or the pullrequest will be closed. |
SUMMARY
Extend module to also modify (zypper mr) repos.
ISSUE TYPE
COMPONENT NAME
zypper_repository
ADDITIONAL INFORMATION
I missed the possibility to modify (zypper mr) existing repositories like
enable
ordisable
. I didn't like theadd
andremove
only approach because I created the repo files via templates with my own naming scheme.Especially when you want to do a zypper dup you need to add the new repos
enabled
whiledisabling
current repos.This extension gives the user more possibilies to use this module.