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

Packer Ansible Issue for Jenkins Projects #11

Closed
techiescamp opened this issue Apr 14, 2023 · 0 comments
Closed

Packer Ansible Issue for Jenkins Projects #11

techiescamp opened this issue Apr 14, 2023 · 0 comments

Comments

@techiescamp
Copy link
Owner

techiescamp commented Apr 14, 2023

Issue 01:

amazon-ebs.jenkins: fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: Unable to negotiate with 127.0.0.1 port 58791: no matching host key type found. Their offer: ssh-rsa", "unreachable": true}

Issue 02:

amazon-ebs.jenkins: fatal: [default]: FAILED! => {"msg": "failed to transfer file to /Users/bibinwilson/.ansible/tmp/ansible-local-50186_ndddr6c/tmp_1v02xx4 ~bibinwilson/.ansible/tmp/ansible-tmp-1681489405.599305-50189-81149797253717/AnsiballZ_setup.py:\n\nscp: dest open "'~bibinwilson/.ansible/tmp/ansible-tmp-1681489405.599305-50189-81149797253717/AnsiballZ_setup.py'": No such file or directory\r\nscp: failed to upload file /Users/bibinwilson/.ansible/tmp/ansible-local-50186_ndddr6c/tmp_1v02xx4 to '~bibinwilson/.ansible/tmp/ansible-tmp-1681489405.599305-50189-81149797253717/AnsiballZ_setup.py'\r\n"}

Cause

This issue is caused due to OpenSSH latest version support with anisble + packer.

References:

Solution

Thes issues can be resolved by adding extra args to the ansible provisioner as shown below.

extra_arguments = [ "--extra-vars", "ami-id=${var.ami_id} efs_mount_point=${var.efs_mount_point}", "--scp-extra-args", "'-O'", "--ssh-extra-args", "-o IdentitiesOnly=yes -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa" ]
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