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

Allow remote ansible provisioner to bypass ssh proxying and simply connect based on sshHostPort state #3846

Closed
andyfeller opened this issue Sep 1, 2016 · 2 comments
Labels
provisioner/ansible-remote question stage/thinking Flagged for internal discussions about possible enhancements

Comments

@andyfeller
Copy link

The ansible provisioner's SSH proxying is overly complicated and adds complexity making it's usage non-trivial and require a fair bit of research to fix. This approach was based upon @bhcleek assertion:

Add an Ansible provisioner that does not require installing Ansible on the machine being provisioned.

For those using ansible in production from control machines that SSH to remote hosts, there is no need to install ansible on the remote machines. Simply specify the user for the connection and either private key or password.

There should be an option to bypass the SSH proxying and have the ansible provisioner pull the sshHostPort state established by the communicator and use this for ansible communications.

@rickard-von-essen rickard-von-essen added question provisioner/ansible-remote stage/thinking Flagged for internal discussions about possible enhancements labels Sep 1, 2016
@rickard-von-essen
Copy link
Collaborator

Packers architecture is plugin based and have three classes of plugins (relevant for this issue) builders, communicators, and provisioners. In short they do:

  • Builders: abstract the state, creation, configuration of a VM.
  • Communicators: abstract the connection towards the VM. Support upload, download, and command execution.
  • Provisioners: Use a communicator to interact with the VM.

Most importantly for this is that communicators hides the details about the connection towards the VM.

That is why the ansible provisioner creates a proxy that connects the communicator and the ansible command. To remove the proxy we need to redesign (and rethink) the fundamental design of Packer.

Some more discussion on this topic #3331

@andyfeller
Copy link
Author

I get that, so let me do this:

I'm going to submit a pull request to cite the situation @rickard-von-essen was good enough to solve for someone else that tripped me up, too. The output around rejecting auth-agent-req@openssh.com request is a red herring to the real issue of /usr/lib/sftp-server needing to be /usr/libexec/openssh/sftp-server in Redhat family.

Thanks @rickard-von-essen once again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
provisioner/ansible-remote question stage/thinking Flagged for internal discussions about possible enhancements
Projects
None yet
Development

No branches or pull requests

2 participants