hashicorp / packer-plugin-ansible

Packer plugin for Ansible Provisioner
https://www.packer.io/docs/provisioners/ansible
Mozilla Public License 2.0
50 stars 36 forks source link

provisioner: add winrm_use_ssl arg to provisioner #160

Closed lbajolet-hashicorp closed 1 year ago

lbajolet-hashicorp commented 1 year ago

When attempting to provision a Windows host with Ansible, without using TLS for the transport layer, Ansible would ignore this option to the communicator, and only use HTTP is the port was set to 5985 by default.

This conflicts with how Packer picks a port for WinRM, which be default is a random port, nullifying the heuristic on Ansible's part.

To circumvent this limitation, we mirror the communicator option winrm_use_ssl, and apply it to the Ansible provisioner, so that it will force usage of HTTP by Ansible.

Closes: #159