Awx: port awx modules to something that is not tower-cli

Created on 29 Oct 2019  路  16Comments  路  Source: ansible/awx

ISSUE TYPE
  • Feature Idea
SUMMARY

awxkit? plain requests? Options abound!

awx_collection high enhancement

Most helpful comment

@kdelee I don't want to munge this in with #5146. Jeff was in agreement with me in-principal that we could add those to his branch / PR. But we shouldn't block the import/export work on having AWX collection modules for them, unless someone has them ready to go. Right now I don't have time for that.

Let's make a new issue for the specific and well-defined task of adding new tower_import and tower_export modules.

All 16 comments

Commenting to put @john-westcott-iv on the conversation. There's also some more background on this.

A pull request https://github.com/ansible/ansible/pull/48649 was raised as a WIP to do exactly this, but it was never fully finished.

@beeankha + @john-westcott-iv, @squidboylan will be your contact for testing this

@beeankha @squidboylan so uh...we ready to needs_test or close this one 馃槃

I think it makes sense to leave this open until all of the modules are ported

Currently remaining:

$ grep -l "from tower_cli" awx_collection/plugins/modules/*.py
awx_collection/plugins/modules/tower_credential.py
awx_collection/plugins/modules/tower_job_template.py
awx_collection/plugins/modules/tower_job_wait.py
awx_collection/plugins/modules/tower_label.py
awx_collection/plugins/modules/tower_notification.py
awx_collection/plugins/modules/tower_receive.py
awx_collection/plugins/modules/tower_role.py
awx_collection/plugins/modules/tower_send.py
awx_collection/plugins/modules/tower_workflow_launch.py
awx_collection/plugins/modules/tower_workflow_template.py

Active PRs that would close out modules:

~These 4 modules~ The latter 3 modules are the ones that we would _replace_, but not _port_. In initial discussions (JT is ported), we talked about replacing tower_role too, but this doesn't make sense to me after looking more at the code. With the association stuff in, I feel fine about doing a straight-forward refactor of that module.

The other 5 of these 10 modules should not be anywhere near the same difficulty. However, not all of them are CRUD type modules (the CRUD modules are eligible to be auto-generated), so similar to tower_role, someone just has to sit down and refactor the code.

  • tower_label in progress - #6361

Latest, after a few merges we recently got in:

grep -l "from tower_cli" awx_collection/plugins/modules/*.py
awx_collection/plugins/modules/tower_credential.py
awx_collection/plugins/modules/tower_job_template.py
awx_collection/plugins/modules/tower_job_wait.py
awx_collection/plugins/modules/tower_notification.py
awx_collection/plugins/modules/tower_receive.py
awx_collection/plugins/modules/tower_send.py
awx_collection/plugins/modules/tower_workflow_launch.py
awx_collection/plugins/modules/tower_workflow_template.py

In progress:
WF: https://github.com/ansible/awx/pull/6291
JT: https://github.com/ansible/awx/pull/6353

cc @beeankha @AlanCoding @john-westcott-iv in case there's anything you're aware of that I'm not.

By this metric this is complete:

$ grep -l "from tower_cli" awx_collection/plugins/modules/*.py
awx_collection/plugins/modules/tower_receive.py
awx_collection/plugins/modules/tower_send.py
awx_collection/plugins/modules/tower_workflow_template.py

Only remaining thing that should be considered is to get better across-the-board messaging.

https://github.com/ansible/awx/blob/eeab4b90a55864c9c80882e25780a914398b9e51/awx_collection/plugins/modules/tower_receive.py#L22-L24

This description for both send & receive should loudly proclaim its deprecation. We don't have a line limit here, this can talk in as much detail as people want about what @jbradberry has in the works. We also need to re-word the send/receive module.deprecate message.

I tried a meta/routing.yml file like in:

https://github.com/ansible-collections/community.general/blob/24405289fe16e4a703928ae5022f6b348fb695ad/meta/routing.yml

But it didn't seem to do anything. I do not remember from prior conversations if this is still in the works (probably along with flatmapping), or it's supposed to work now. If it did work, I would add this file:

plugin_routing:
  modules:
    tower_receive:
      deprecation:
        removal_date: TBD
        warning_text: will be replaced by export command in the new AWX CLI
    tower_send:
      deprecation:
        removal_date: TBD
        warning_text: will be replaced by import command in the new AWX CLI
    tower_workflow_template:
      deprecation:
        removal_date: TBD
        warning_text: replaced by tower_workflow_job_template and tower_workflow_job_template_node

I think we _also_ need to update the status

https://github.com/ansible/awx/blob/eeab4b90a55864c9c80882e25780a914398b9e51/awx_collection/plugins/modules/tower_receive.py#L12

from "preview" to "deprecated", as done here:

https://github.com/ansible-collections/community.general/blob/46914b857c55221f7047ac32c68ca83f34739293/plugins/modules/cloud/digital_ocean/digital_ocean_sshkey_facts.py#L12

Also done there - the DOCUMENTATION has a deprecated: key. We tried this before, but it failed the sanity tests.

So we have several TODO items here. Some basic documentation touchups can be done now, but the overall way of deprecating content in collections is blocked pending clear messaging by the Ansible core team now.

This takes care of some minor things I mentioned

https://github.com/ansible/awx/pull/6700

@squidboylan I think you are best to say if this is done. AFAIK you've been testing each step of the way, so probably ready to close

is this done even though import/export isnt done? Should we close this and add issues for import/export modules?

@wenottingham could use some clarification here.

I'm thinking we can make a new issue for the import/export new implementation based on awx cli and call this issue done.

linking https://github.com/ansible/awx/issues/5146 ...thats the "implement import/export in awx cli" issue.

Yeah, I'm fine with closing this out and having import/export as a followon issue.

@kdelee I don't want to munge this in with #5146. Jeff was in agreement with me in-principal that we could add those to his branch / PR. But we shouldn't block the import/export work on having AWX collection modules for them, unless someone has them ready to go. Right now I don't have time for that.

Let's make a new issue for the specific and well-defined task of adding new tower_import and tower_export modules.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IMOKURI picture IMOKURI  路  3Comments

marshmalien picture marshmalien  路  3Comments

darkaxl picture darkaxl  路  3Comments

agaffney picture agaffney  路  3Comments

astraios picture astraios  路  3Comments