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

[v2] Allow direct input of popular credential fields in v2 #356

Open
AlanCoding opened this issue Sep 19, 2017 · 5 comments

Comments

2 participants
@AlanCoding
Copy link
Member

commented Sep 19, 2017

from prior suggestion:

what if we kept shortcuts for the v1 fields (i.e., --username, --password, etc... are still available, they just auto-map to the inputs dict), and for custom types, you just have to pass in JSON?

Keep the simple use-cases simple. Let the complex things be possible.

@akcrisp

This comment has been minimized.

Copy link

commented Dec 13, 2017

this should support directly pointing it at the ssh key file ie --inputs'{"ssh_key_data": ~/.ssh/id_rsa}' rather than expecting the actual key.

This needs fixing asap.

@AlanCoding

This comment has been minimized.

Copy link
Member Author

commented Dec 13, 2017

Feel free to have a stab at it. The thinking here is to have options like --ssh-key-data=..., then you could accept files. The syntax pattern needs consideration, I think that older versions like 3.1.8 would consider ... to be a file.

This would require a translation layer to be added, and I think we have a good example with unified_job_template_options. This decorator could implement options ssh_key_data and inputs together, and combine them.

https://github.com/ansible/tower-cli/blob/master/tower_cli/utils/resource_decorators.py#L22

But this is different from the problem that $(cat ~/.ssh/id_rsa) won't really work - that's because the line breaks are removed. tower-cli could have a conditional to convert spaces into line breaks, but that kind of highly-automatic behavior can have surprising consequences.

@akcrisp

This comment has been minimized.

Copy link

commented Dec 13, 2017

@AlanCoding

This comment has been minimized.

Copy link
Member Author

commented Dec 13, 2017

I believe --user is for the owner of the credential in AWX. It's not required in the code I have here, that might have been changed, I don't remember.

@akcrisp

This comment has been minimized.

Copy link

commented Dec 13, 2017

@AlanCoding AlanCoding modified the milestones: release_3.2.2, release_3.3.2 Apr 25, 2018

@AlanCoding AlanCoding added this to needs_devel in Credential fixing Apr 27, 2018

@AlanCoding AlanCoding added P1 and removed P2 labels Jun 13, 2018

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.