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

Fix ansible SSH not connecting #1014

Closed
wants to merge 1 commit into from

Conversation

agtogna
Copy link

@agtogna agtogna commented Nov 5, 2022

What this PR does / why we need it:

Fix Ansible SSH not connecting because the image uses an ssh-rsa key which is disabled by default in recent OpenSSH.

Ansible SSH, since recent OpenSSH has disabled the usage of "old" ssh-rsa keys, cannot connect to the image; the Ubuntu 20.04 image still uses ssh-rsa.

make build-node-ova-vsphere-ubuntu-2004

  vsphere:
   vsphere: PLAY [all] *********************************************************************
==> vsphere: failed to handshake
   vsphere:
   vsphere: TASK [Gathering Facts] *********************************************************
   vsphere: fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Unable to negotiate with 127.0.0.1 port 43161: no matching host key type found. Their offer: ssh-rsa", "unreachable": true}
   vsphere:
   vsphere: PLAY RECAP *********************************************************************
   vsphere: default                    : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0
   vsphere:

This PR adds the correct options to ANSIBLE_SSH_ARGS to have Ansible connect.

Fix ansible SSH not connecting because the image uses an ssh-rsa key which is not enabled by default in recent OpenSSH
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 5, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: agtogna-nc / name: Alessandro Giorgio Togna (4cf93d7)

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 5, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @agtogna-nc. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot
Copy link
Contributor

Welcome @agtogna-nc!

It looks like this is your first PR to kubernetes-sigs/image-builder 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/image-builder has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 5, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: agtogna-nc
Once this PR has been reviewed and has the lgtm label, please assign gab-satchi for approval by writing /assign @gab-satchi in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Nov 5, 2022
@kkeshavamurthy
Copy link
Member

@agtogna Can you add the versions which is causing this issue so that I can reproduce it.

@agtogna
Copy link
Author

agtogna commented Nov 22, 2022

here they are:

packer --version
1.8.4

ansible --version
ansible [core 2.11.5] 
  config file = /home/agtogna/workdir/image-builder/images/capi/ansible.cfg
  configured module search path = ['/home/agtogna/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/agtogna/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/agtogna/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/agtogna/.local/bin/ansible
  python version = 3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0]
  jinja version = 3.1.2
  libyaml = True

@Meecr0b
Copy link
Contributor

Meecr0b commented Dec 2, 2022

related to #905
Dennis Lerch dennis.lerch@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH, Provider Information

@invidian
Copy link
Member

invidian commented Dec 2, 2022

See also #907.

@kkeshavamurthy
Copy link
Member

@agtogna Seems like there's an issue and a PR open to fix this. Do we still need this PR or can it be closed?

@invidian
Copy link
Member

I've opened #1035 which will close this PR if it gets merged, as it provides more broader fixes and also includes changes from this PR.

@agtogna
Copy link
Author

agtogna commented Dec 15, 2022

@agtogna Seems like there's an issue and a PR open to fix this. Do we still need this PR or can it be closed?

It can be closed, I'll follow #1035 instead.
Thank you.

@agtogna agtogna closed this Dec 15, 2022
@agtogna agtogna deleted the fix_ansible branch June 7, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants