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

Declare connection plugin variables and use them with get_option #31

Conversation

dmp1ce
Copy link

@dmp1ce dmp1ce commented May 11, 2021

  • Declare all SSH variables from ssh.py
  • Use self.get_option where required
  • Update the _build_command from latest ssh.py
  • Declare lxc_host variable for declaring the container name to use

Fixes #30

The lxc_host needed to be created because the new _build_command function messes with the ssh args I think. I couldn't get the script to work without adding the lxc_host variable which I think makes more sense for the plugin anyway.

@stefangweichinger
Copy link

testing it right now with debops.lxc

@andreasscherbaum
Copy link
Owner

@dmp1ce I added a test matrix for different Ansible versions: #32
Can you rebase your patch please, and let's see if it works with all versions. Thanks!

@dmp1ce dmp1ce force-pushed the issue-30-declare-variables-add-lxc_host-var branch from 90227e3 to b60d14f Compare May 15, 2021 11:45
lxc_ssh.py Outdated
self._add_args(
b_command, (
b"-o", b"KbdInteractiveAuthentication=no",
b"-o", b"PreferredAuthentications=publickey,gssapi-with-mic,gssapi-keyex,hostbased",
b"-o", b"PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor question: why do you turn the authentication methods around?
In your PR "publickey" is now the last methog, and all the other ones need to be checked first, that is time-consuming.
Is there a logical explanation for this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I blindly copied over the settings from ssh.py. I figured ssh.py had it in that order for a reason. Most likely this line change is not needed for the #30 fix.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think when you remove this from the PR I can merge it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My latest force push removes this change. 4e569a7

@andreasscherbaum
Copy link
Owner

@dmp1ce Thanks for verifying. I have one last code question left, which is more a performance issue. See the inline comment please.

@andreasscherbaum
Copy link
Owner

Oh, and there is another PR merged in the meantime, that might require another rebase of your PR.

@dmp1ce dmp1ce force-pushed the issue-30-declare-variables-add-lxc_host-var branch 2 times, most recently from e6f8983 to 774c2d6 Compare May 15, 2021 19:13
- Declare all SSH variables from ssh.py
- Use self.get_option where required
- Update the _build_command from latest ssh.py
- Declare lxc_host variable for declaring the container name to use
@dmp1ce dmp1ce force-pushed the issue-30-declare-variables-add-lxc_host-var branch from 774c2d6 to 4e569a7 Compare May 15, 2021 19:15
@andreasscherbaum andreasscherbaum merged commit 1132360 into andreasscherbaum:master May 15, 2021
@andreasscherbaum
Copy link
Owner

Thanks for this PR! Really appreciated.

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

Successfully merging this pull request may close these issues.

AttributeError: module 'ansible.constants' has no attribute 'ANSIBLE_SSH_CONTROL_PATH'
3 participants