Open AlanCoding opened 7 years ago
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.
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.
Alan,can you explain why the user param is still required ? given I assume this is the user that ssh will login as ? there’s no other user associated with the cred in awx.
tower-cli credential create --name="SSH example" --user=$userval --inputs="$machine_cred_inputs" --credential-type=“Machine"
On 13 Dec 2017, at 15:29, Alan Rominger notifications@github.com wrote:
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 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.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ansible/tower-cli/issues/356#issuecomment-351425279, or mute the thread https://github.com/notifications/unsubscribe-auth/ATZJnNFG5l2TcW3vxvJ1ei4htf2YncNXks5s_-1GgaJpZM4PcvN-.
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.
Ok
Sent from my iPhone
On 13 Dec 2017, at 16:38, Alan Rominger notifications@github.com wrote:
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.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
from prior suggestion:
Keep the simple use-cases simple. Let the complex things be possible.