Merge pull request #6501 from Wenzel/expose_ansible_packer_http_addr
Expose ansible packer_http_addr extra var
This commit is contained in:
commit
a5a6b1ab58
|
@ -366,6 +366,13 @@ func (p *Provisioner) executeAnsible(ui packer.Ui, comm packer.Communicator, pri
|
||||||
// args = append(args, "--private-key", privKeyFile)
|
// args = append(args, "--private-key", privKeyFile)
|
||||||
args = append(args, "-e", fmt.Sprintf("ansible_ssh_private_key_file=%s", privKeyFile))
|
args = append(args, "-e", fmt.Sprintf("ansible_ssh_private_key_file=%s", privKeyFile))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// expose packer_http_addr extra variable
|
||||||
|
httpAddr := common.GetHTTPAddr()
|
||||||
|
if httpAddr != "" {
|
||||||
|
args = append(args, "--extra-vars", fmt.Sprintf("packer_http_addr=%s", httpAddr))
|
||||||
|
}
|
||||||
|
|
||||||
args = append(args, p.config.ExtraArguments...)
|
args = append(args, p.config.ExtraArguments...)
|
||||||
if len(p.config.AnsibleEnvVars) > 0 {
|
if len(p.config.AnsibleEnvVars) > 0 {
|
||||||
envvars = append(envvars, p.config.AnsibleEnvVars...)
|
envvars = append(envvars, p.config.AnsibleEnvVars...)
|
||||||
|
|
|
@ -163,6 +163,13 @@ commonly useful Ansible variables:
|
||||||
machine that the script is running on. This is useful if you want to run
|
machine that the script is running on. This is useful if you want to run
|
||||||
only certain parts of the playbook on systems built with certain builders.
|
only certain parts of the playbook on systems built with certain builders.
|
||||||
|
|
||||||
|
- `packer_http_addr` If using a builder that provides an http server for file
|
||||||
|
transfer (such as hyperv, parallels, qemu, virtualbox, and vmware), this
|
||||||
|
will be set to the address. You can use this address in your provisioner to
|
||||||
|
download large files over http. This may be useful if you're experiencing
|
||||||
|
slower speeds using the default file provisioner. A file provisioner using
|
||||||
|
the `winrm` communicator may experience these types of difficulties.
|
||||||
|
|
||||||
## Debugging
|
## Debugging
|
||||||
|
|
||||||
To debug underlying issues with Ansible, add `"-vvvv"` to `"extra_arguments"` to enable verbose logging.
|
To debug underlying issues with Ansible, add `"-vvvv"` to `"extra_arguments"` to enable verbose logging.
|
||||||
|
|
Loading…
Reference in New Issue