drone-plugins / drone-ansible

Drone plugin to provision via Ansible
http://plugins.drone.io/drone-plugins/drone-ansible
Apache License 2.0
31 stars 44 forks source link

Load ssh key into the agent so ansible-galaxy picks it up #46

Closed matijavizintin closed 1 year ago

matijavizintin commented 3 years ago

Currently ansible-galaxy install doesn't take into account the PrivateKey parameter and unfortunately it doesn't support --private-key parameter as the ansible command does.

If you have requirements that are fetched from a private repo via ssh and you need to load the private key into the ssh agent. So instead of dumping the private key into a temp file now it is stored into the default location where the ssh agent picks it up.

The PR is related to https://github.com/drone-plugins/drone-ansible/issues/45

markocelan commented 2 years ago

can we move forward with this?

sprnza commented 2 years ago

It's a shame how long it takes for PR to be approved in this project.

tphoney commented 2 years ago

Hey folks, sorry for the delay on the review. I am not an ansible expert. but this could have unforseen side affects. Particularly if the user has already set up ssh for other things. Is it possible to allow the setting of the key folder as a variable

matijavizintin commented 2 years ago

@tphoney You are right, if the user is configuring the ssh key inside the testing container then this setting will be overridden (I'm assuming that plugin is loaded before user's commands are executed). Unfortunately it's not possible to pass the key location to ansible-galaxy and it tries to auth only with what is loaded in the ssh agent.