ansible/awx

AWX Collection Credential Delete

Open

#14,209 opened on Jul 6, 2023

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Python (3,333 forks)batch import
Hacktoberfestcomponent:awx_collectiongood first issuehelp wanted

Repository metrics

Stars
 (13,071 stars)
PR merge metrics
 (Avg merge 24d 6h) (30 merged PRs in 30d)

Description

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • I am NOT reporting a (potential) security vulnerability. (These should be emailed to security@ansible.com instead.)

Bug Summary

When deleting a credential from the awx.awx collection the credential_type is currently a required parameter but no error is thrown if its missing.

However, it should not be a requirement at all in some cases. For example, if we are passing in an ID or a named URL (once https://github.com/ansible/awx/pull/14205 merges) then the credential type would be irrelevant as we would find a unique credential. The module should be rewritten to be able to delete a credential from just the name field.

We should also update the unit test files to include a test of just deleting by name or named URL.

AWX version

latest

Select the relevant components

  • UI
  • UI (tech preview)
  • API
  • Docs
  • Collection
  • CLI
  • Other

Installation method

N/A

Modifications

no

Ansible version

No response

Operating system

No response

Web browser

No response

Steps to reproduce

Write a playbook to create a credential and then attempt to delete the credential with just name set to either ID or named URL and state: absent. Run the playbook, it should fail to delete the credential.

Expected results

Credential should be deleted.

Actual results

Failed step from the playbook.

Additional information

No response

Contributor guide