When a builder doesn't set packer_http_addr, the Ansible-local provisioner sets packer_http_addr=%!s(<nil>) in the command during the execution of the Ansible stage. This results in some builders encountering command syntax errors.
Reproduction Steps
Navigate to the source directory of Ansible-local.
The expected command should be:
--extra-vars "packer_build_name= packer_builder_type= packer_http_addr= -o IdentitiesOnly=yes"
The issue arises because packer_http_addr should be set as an empty string when it's nil.
Plugin and Packer version
Packer 1.9.4
packer-plugin-ansible 1.1.0
I have made a pretty simple patch to fix this issue.
Overview of the Issue
When a builder doesn't set
packer_http_addr
, the Ansible-local provisioner setspacker_http_addr=%!s(<nil>)
in the command during the execution of the Ansible stage. This results in some builders encountering command syntax errors.Reproduction Steps
The expected command should be:
--extra-vars "packer_build_name= packer_builder_type= packer_http_addr= -o IdentitiesOnly=yes"
The issue arises because packer_http_addr should be set as an empty string when it's nil.Plugin and Packer version
I have made a pretty simple patch to fix this issue.