Packer v1.2.4
Ubuntu 18.04 LTS
2.6.0
Hi !
my working tree is the following:
~
$ tree -I venv
.
โโโ ansible
โย ย โโโ connection_plugins
โย ย โย ย โโโ packer.py
โย ย โย ย โโโ packer.pyc
โย ย โโโ default.retry
โย ย โโโ default.yml
โโโ answer_files
โย ย โโโ 10
โย ย โโโ Autounattend.xml
โโโ packer
โโโ packer_cache
โโโ scripts
โย ย โโโ fixnetwork.ps1
โย ย โโโ setup_winrm_public.bat
โโโ windows_10.json
~
When i run ./packer build windows_10.json
, the provisioning fail with the following error:
~
2018/06/29 16:07:37 ui: qemu: TASK [Gathering Facts] *******************
2018/06/29 16:07:37 ui: qemu: task path: /home/tarrma/tmp/bug_packer/ansible/default.yml:2
qemu: task path: /home/tarrma/tmp/bug_packer/ansible/default.yml:2
qemu: <127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: tarrma
2018/06/29 16:07:37 ui: qemu: <127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: tarrma
qemu: fatal: [default]: FAILED! => {
2018/06/29 16:07:37 ui: qemu: fatal: [default]: FAILED! => {
qemu: "msg": "Invalid settings supplied for use_tty: 'connection'"
2018/06/29 16:07:37 ui: qemu: "msg": "Invalid settings supplied for use_tty: 'connection'"
2018/06/29 16:07:37 ui: qemu: }
qemu: }
~
Windows template to reproduce the build (Gist)
-> Could it be that ansible is using SSH instead of winrm to connect and is confused by the connection
plugin ?
I hope this helps !
Thanks.
I created this repository to help the you reproduce the bug:
https://github.com/Wenzel/bug_packer_ansible
The solution has been given to me by @adarobin .
From Ansible 2.4.x and above, you need to add a DOCUMENTATION
string to the connection plugin.
Gist
We should update the documentation of the Ansible provisioner:
https://github.com/hashicorp/packer/pull/6454
@SwampDragons I confirm that the build works with Ansible 2.6.0
now.
Feel free to close this issue once the documentation will have been updated !
Thanks.
Awesome, thanks for the update! I'll review that docs change ASAP.
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
The solution has been given to me by @adarobin .
From Ansible 2.4.x and above, you need to add a
DOCUMENTATION
string to the connection plugin.Gist
We should update the documentation of the Ansible provisioner:
https://github.com/hashicorp/packer/pull/6454
@SwampDragons I confirm that the build works with Ansible
2.6.0
now.Feel free to close this issue once the documentation will have been updated !
Thanks.