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

import/export modules #7329

Closed
kdelee opened this issue Jun 11, 2020 · 7 comments
Closed

import/export modules #7329

kdelee opened this issue Jun 11, 2020 · 7 comments
Labels
component:awx_collection issues related to the collection for controlling AWX type:enhancement

Comments

@kdelee
Copy link
Member

kdelee commented Jun 11, 2020

ISSUE TYPE
  • Feature Idea

Add to the tower collection modules that perform import/export type things.

Open Questions:

  • currently CLI always updates --- that's not the ansible way, what do we want to do to fix this?
    • check if object of same name exists and not update unless force: true
    • OR....more granular check if sub items have changed, this would be more work

needs more fleshing out

related to #5146

@kdelee kdelee added type:enhancement state:needs_devel component:awx_collection issues related to the collection for controlling AWX labels Jun 11, 2020
@AlanCoding
Copy link
Member

@john-westcott-iv already has some material for this.

@john-westcott-iv
Copy link
Member

We are writing import/export modules here #6125
But they use the CLI libraries which, as you mention, currently always report changed.

@ryanpetrello
Copy link
Contributor

@john-westcott-iv is there a branch or PR for this work somewhere?

@AlanCoding
Copy link
Member

https://github.com/jbradberry/awx/pull/3

b1d83dd...john-westcott-iv:import-export-collection

That is relative to @jbradberry's import/export branch, which has changed in the meantime. Rebasing it may or may not work, squashing and cherry-picking might be better, and even that would introduce a lot of conflicts.

The original work started with refactoring some of the base class, and other lighter parallel refactoring has happened elsewhere. We do need to swap out the logic for making requests, login, and logout. However, we still need to share the code for processing the authentication parameter processing. Even with awxkit, IIRC, you still initialize your own client/connection/session/whatever it is. This was the non-obvious thing that took me a while to accept.

@john-westcott-iv
Copy link
Member

@ryanpetrello The modules are stuck in some PR gridlock:

We need #7286 (lookup plugins) to go in.
Once that is done we need to refactor and merge #6615 which splits the modules utils out into tower_api and tower_connector.
After that we can refactor #6125 on to awx/devel and finish up the tests.

@AlanCoding
Copy link
Member

Maybe some updated version of #6615, my concerns about that refactor are specifically due to this awxkit integration. The TowerConnector class got all of the config processing logic in that split. That might sound logical, because it's not what happens in practice, because awxkit doesn't do any work for us in terms of processing module parameters or config files.

The logic that awxkit will re-implement will be specifically login/logout/make_request, but even that seems like too much. Will these modules create a new token if given username/password? That's not something the AWX CLI does.

There is a lot of logic around handling error codes, and that may be left to awxkit to raise exceptions. I'm curious what other people envision for this.

The collection will be primed for refactoring after we the details hashed out about what responsibilities lie where. awxkit has a completely independent code lineage from the collection, and because of that, it sends us back to basic design questions.

@ryanpetrello
Copy link
Contributor

PR: #7799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:awx_collection issues related to the collection for controlling AWX type:enhancement
Projects
None yet
Development

No branches or pull requests

6 participants