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 support for --diff #197

Open
ktdreyer opened this issue Aug 5, 2020 · 2 comments
Open

add support for --diff #197

ktdreyer opened this issue Aug 5, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@ktdreyer
Copy link
Owner

ktdreyer commented Aug 5, 2020

Ansible has the ability to show the "diff" for a configuration:
https://blog.networktocode.com/post/generating-diff-with-ansible/

We might be able to use this instead of rolling our own diff output. As one example, koji_tag's ensure_inheritance() prints the "before" and "after" settings using describe_inheritance().

@ktdreyer ktdreyer added the enhancement New feature or request label Aug 5, 2020
@simonbaird
Copy link

Now ktdreyer/errata-tool-ansible#207 is merged, I'm planning to take a look at this one.

FYI there's an internal tracker for it at https://issues.redhat.com/browse/CWFCONF-1064 .

@ktdreyer
Copy link
Owner Author

ktdreyer commented Nov 9, 2021

I looked at this recently for a small module (koji_tag_packages.py).

In ktdreyer/errata-tool-ansible@720e943, we always had a single huge dict of the current state (eg. from get_product(), or get_release(), etc), and it's straightforward to diff that against the module's params.

In contrast, the modules in koji-ansible have many different "get" methods scattered throughout. It's difficult to build up a total "current state" dict to diff against.

This reminds me of #30 . I'm thinking of refactoring the koji-ansible modules to have two stages: a "gather" stage where we read all the information we're going to need from the hub (ideally in a single multicall RPC). Then the second stage would "apply" the changes the user requested.

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

No branches or pull requests

2 participants