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

breaking change in ansible 2.12.3 - connecting to myjail@host instead of host #40

Open
hugopeixoto opened this issue Mar 6, 2022 · 0 comments

Comments

@hugopeixoto
Copy link

I'm not using sshjail, but I'm using sshlxd which started as a fork and I think this problem applies to both.

Ansible 2.12.3 includes this pull request which overwrites self.host in a bunch of places. This means that ansible will try to ssh into myjail@address (and fail) instead of just connecting to address.

My fix for this was to add a self.set_option('host', self.host) in exec_command:

def exec_command(self, cmd, in_data=None, executable='/bin/sh', sudoable=True):
    ''' run a command in the container '''

    self.set_option('host', self.host)
    cmd = '%s exec %s -- %s' % (self.get_container_connector(), self.get_container_id(), cmd)

    return super(Connection, self).exec_command(cmd, in_data, True)
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Mar 7, 2022
Changes in recent py-ansible-core 2.12.3 cause connection falures
in ansible-sshjail. Apply suggested fix from upstream issue report.

While here rename patch file.

Obtained from:	austinhyde/ansible-sshjail#40
camachat pushed a commit to camachat/freebsd-ports that referenced this issue Mar 9, 2022
Changes in recent py-ansible-core 2.12.3 cause connection falures
in ansible-sshjail. Apply suggested fix from upstream issue report.

While here rename patch file.

Obtained from:	austinhyde/ansible-sshjail#40
wombelix added a commit to wombelix/fork_austinhyde_ansible-sshjail that referenced this issue Mar 26, 2022
znek added a commit to znek/ansible-sshjail that referenced this issue Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant