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

In tower_credential module, add credential_type parameter #56246

Open
wants to merge 1 commit into
base: stable-2.7
from

Conversation

Projects
None yet
4 participants
@jladdjr
Copy link
Contributor

commented May 9, 2019

SUMMARY

Adds the credential_type parameter to the tower_credential module. This will allow users to create credentials that use custom credential types.

The kind parameter is still supported for backwards compatibility.

Fixes #54493

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

tower_credential module

@ansibot

This comment has been minimized.

@jladdjr jladdjr force-pushed the jladdjr:tower_cred_type branch from 9971521 to 082f8da May 13, 2019

choices: ["ssh", "vault", "net", "scm", "aws", "vmware", "satellite6", "cloudforms", "gce", "azure_rm", "openstack", "rhv", "insights", "tower"]
credential_type:

This comment has been minimized.

Copy link
@jladdjr

jladdjr May 13, 2019

Author Contributor

Can now specify custom credential type using credential_type field

This comment has been minimized.

Copy link
@AlanCoding

AlanCoding May 14, 2019

Member

I could have sworn I remembered some pattern for requiring one out of a list of fields, but can't find it now.

description:
- Name of credential type.
required: False
version_added: "2.7"

This comment has been minimized.

Copy link
@jladdjr

jladdjr May 13, 2019

Author Contributor

Is there any need for this to show up in an earlier version of Ansible?

This comment has been minimized.

Copy link
@AlanCoding

AlanCoding May 14, 2019

Member

I think you need to first merge to devel, and then you can backport to stable-2.7.

I think the core team says they don't backport features, so... the backport might not work either.

@@ -207,8 +228,9 @@ def main():
name=dict(required=True),
user=dict(),
team=dict(),
kind=dict(required=True,

This comment has been minimized.

Copy link
@jladdjr

jladdjr May 13, 2019

Author Contributor

kind no longer required since you can specify credential_type instead

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 13, 2019

params['credential_type'] = credential_type['id']

if module.params.get('inputs'):
params['inputs'] = module.params.get('inputs')

This comment has been minimized.

Copy link
@jladdjr

jladdjr May 13, 2019

Author Contributor

If we support custom cred types, need to make sure we support inputs as well

@jladdjr

This comment has been minimized.

Copy link
Contributor Author

commented May 13, 2019

@stana (cc @spasarok @ryanpetrello) - this should let you create a credential using a custom credential type. Added two new fields to make this possible: credential_type and inputs. Tested this and confirmed I was able to create custom creds w/ inputs. Let me know if this works for you.

@ansibot ansibot removed the needs_triage label May 14, 2019

@stana

This comment has been minimized.

Copy link

commented May 16, 2019

@jladdjr this works. The only thing when inputs provided module always reports result as changed. But I think this is an issue with tower_cli lib. So looks good. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.