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

Expose connection settings in communicator to provisioners #3889

Closed
The-Loeki opened this issue Sep 15, 2016 · 8 comments
Closed

Expose connection settings in communicator to provisioners #3889

The-Loeki opened this issue Sep 15, 2016 · 8 comments
Assignees
Labels
communicator/ssh enhancement post-1.0 stage/thinking Flagged for internal discussions about possible enhancements

Comments

@The-Loeki
Copy link
Contributor

The-Loeki commented Sep 15, 2016

I'm trying to write a provisioner plugin for Salt SSH.
The process is largely similar to what Ansible does; open an SSH pipe and start doing stuff.

The problem I'm facing is therefore the same Ansible and a lot of other plugins seem to face: there's no access to the connection settings the Communicator already knows and the UI presents to me..
This leads to a lot of workarounds, from the Ansible Provisioner's 'SSH Proxy/Adaptor' to OpenStack's API calling to get that info again. it also leads to confusion (#3828) among users and and often the name has to show up multiple times in the JSON.

From what I can tell it's a matter of either adding a small method to provide that info or exposing the Config struct to the provisioners.

I propose to add such a function to the Communicator interface or expose Config.

Is that a good idea or am I missing a very good reason not to do it? Or is the situation much more complex than I'm anticipating now?

Related discussions:

@rickard-von-essen
Copy link
Collaborator

See #3331.

@rickard-von-essen
Copy link
Collaborator

#2991 is a bug and I think it has been fixed.

@rickard-von-essen
Copy link
Collaborator

I'm not sure what you mean by

OpenStack's API calling to get that info again.

And

The problem I'm facing is therefore the same Ansible and a lot of other plugins seem to face

Actually only ansible remote, and now you.

@The-Loeki
Copy link
Contributor Author

ghehehe that hurt man ;) I thought I looked diligently, my apologies :)

Anyway, it seems the concerns focus around lack of use case (which I apparently read very wrong in the other plugins ;) ) and the availability of the SSH Proxy the Ansible provisioner already uses...

So my use case is Salt SSH, which, as mentioned is pretty similar to Ansible in setup. Given enough interest I'm planning to commit it here once it works.

In the meantime, is this sufficient to warrant further discussion or am I going to try to plug in the adaptor from the Ansible provisioner?

@rickard-von-essen
Copy link
Collaborator

I'm open for reviewing this design again. But this is a core design of Packer so changes must be done carefully with a well thought out design.

@cbednarski I guess these use cases will pop up from time to time. Maybe it's time to see if we can extend packer to allow such communication?

@chris-smith-zocdoc
Copy link

#3911 is impacted by this decision. If the connection settings were exposed, it should make adding support for Ansible + WinRM easier.

@kwilczynski
Copy link
Contributor

@The-Loeki this is something that I was trying to convince people to do for some time.

Thank you so much for formalising what needs to be done in this issue.

@mwhooker
Copy link
Contributor

mwhooker commented Feb 6, 2017

This is a big question and not something we're ready to implement. We should revisit this after 1.0.

@mwhooker mwhooker closed this as completed Feb 6, 2017
@mwhooker mwhooker added post-1.0 stage/thinking Flagged for internal discussions about possible enhancements labels Feb 6, 2017
@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
communicator/ssh enhancement post-1.0 stage/thinking Flagged for internal discussions about possible enhancements
Projects
None yet
Development

No branches or pull requests

5 participants