Packer: Ansible: Invalid settings supplied for use_tty

Created on 29 Jun 2018  ยท  4Comments  ยท  Source: hashicorp/packer

  • Packer version: Packer v1.2.4
  • Host platform: Ubuntu 18.04 LTS
  • Debug log
  • Ansible version: 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.

bug help wanted provisioneansible-remote

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.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings