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

Update metadata for the AWX collection #6016

Conversation

AlanCoding
Copy link
Member

SUMMARY

We know a lot more now than we did when this was written. This is just trying to update some of the meta stuff to the current reality.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • AWX collection
AWX VERSION
9.2.0
ADDITIONAL INFORMATION

Tested as alancoding.awx:9.2.1

https://galaxy.ansible.com/alancoding/awx

The playbook changes are to make this much much more compact:

TASK [Change files to support desired namespace and package names] ******************************************************************************************************************
changed: [localhost] => (item=/plugins/modules/tower_team.py)
changed: [localhost] => (item=/plugins/modules/tower_role.py)
changed: [localhost] => (item=/plugins/modules/tower_inventory.py)
changed: [localhost] => (item=/plugins/modules/tower_workflow_launch.py)
changed: [localhost] => (item=/plugins/modules/tower_credential.py)
changed: [localhost] => (item=/plugins/modules/tower_label.py)
changed: [localhost] => (item=/plugins/modules/tower_group.py)
changed: [localhost] => (item=/plugins/modules/tower_send.py)
changed: [localhost] => (item=/plugins/modules/tower_job_cancel.py)
changed: [localhost] => (item=/plugins/modules/tower_host.py)
changed: [localhost] => (item=/plugins/modules/tower_credential_type.py)
ok: [localhost] => (item=/plugins/modules/__init__.py)
changed: [localhost] => (item=/plugins/modules/tower_user.py)
changed: [localhost] => (item=/plugins/modules/tower_inventory_source.py)
changed: [localhost] => (item=/plugins/modules/tower_receive.py)
changed: [localhost] => (item=/plugins/modules/tower_notification.py)
changed: [localhost] => (item=/plugins/modules/tower_organization.py)
changed: [localhost] => (item=/plugins/modules/tower_job_list.py)
changed: [localhost] => (item=/plugins/modules/tower_job_launch.py)
changed: [localhost] => (item=/plugins/modules/tower_workflow_template.py)
changed: [localhost] => (item=/plugins/modules/tower_project.py)
changed: [localhost] => (item=/plugins/modules/tower_job_template.py)
changed: [localhost] => (item=/plugins/modules/tower_settings.py)
changed: [localhost] => (item=/plugins/modules/tower_job_wait.py)

Additionally, this allows me to run the sanity tests as alancoding.awx.

Also, here's testing for this new target:

make build_collection COLLECTION_NAMESPACE=alancoding
make test_collection_sanity COLLECTION_NAMESPACE=alancoding
make symlink_collection COLLECTION_NAMESPACE=alancoding
ansible-playbook -i localhost, test.yml -e ansible_python_interpreter=$(which python)

with

$ cat test.yml 
---

- hosts: all
  gather_facts: false
  connection: local
  tasks:
    - alancoding.awx.tower_organization:
        name: Steve

and if I put in an exception to the file:

$ ansible-playbook -i localhost, test.yml -e ansible_python_interpreter=$(which python)
[WARNING]: You are running the development version of Ansible. You should only run Ansible from "devel" if you are modifying the Ansible engine, or trying out features under
development. This is a rapidly changing source of code and can become unstable at any point.

PLAY [all] **************************************************************************************************************************************************************************

TASK [alancoding.awx.tower_organization] ********************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: Testing that changes take effect!
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/Users/alancoding/.ansible/tmp/ansible-tmp-1582231676.525352-131503910515221/AnsiballZ_tower_organization.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/Users/alancoding/.ansible/tmp/ansible-tmp-1582231676.525352-131503910515221/AnsiballZ_tower_organization.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/Users/alancoding/.ansible/tmp/ansible-tmp-1582231676.525352-131503910515221/AnsiballZ_tower_organization.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.alancoding.awx.plugins.modules.tower_organization', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/var/folders/fj/6z5pn3wj5w31zvn2pws34svm0000gn/T/ansible_alancoding.awx.tower_organization_payload_fqm32jfu/ansible_alancoding.awx.tower_organization_payload.zip/ansible_collections/alancoding/awx/plugins/modules/tower_organization.py\", line 116, in <module>\n  File \"/var/folders/fj/6z5pn3wj5w31zvn2pws34svm0000gn/T/ansible_alancoding.awx.tower_organization_payload_fqm32jfu/ansible_alancoding.awx.tower_organization_payload.zip/ansible_collections/alancoding/awx/plugins/modules/tower_organization.py\", line 81, in main\nException: Testing that changes take effect!\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

PLAY RECAP **************************************************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

This doesn't work with ansible-test, and it might not even work forever in this form. But nothing lasts forever anyway.


- Removing tower-cli as a dependency
- Renaming the modules, for example `tower_organization` to just `organization`
and giving a deprecation period for the switch
Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't really on the agenda now (we could revisit it, but I wouldn't say the decision is made)

and this isn't the best place, we should handle these in issues.

@AlanCoding
Copy link
Member Author

I actually made this with the specific intention of merging before #5747

that makes some changes to the README.md but shouldn't conflict.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@AlanCoding AlanCoding added the component:awx_collection issues related to the collection for controlling AWX label Feb 21, 2020
Copy link
Contributor

@beeankha beeankha left a comment

Choose a reason for hiding this comment

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

👍

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit a03d737 into ansible:devel Feb 21, 2020
@AlanCoding AlanCoding deleted the collection_metadata_update branch May 29, 2020 19:26
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

Successfully merging this pull request may close these issues.

4 participants