hashicorp / hashicorp/packer-plugin-sdk

Option to ignore SSH communicator disconnection in provisioning plugins

Open
#277 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
42
Forks
62
Avg merge
29m
Merged PRs (30d)
2

Description

When running an ansible provisioner that triggers reboots the builder communicator stops and cannot reconnect.
As the provisioner is:
1. local to the Packer host running the builder, and
2. already aware and perfectly capable of managing disconnections gracefully

This feature request is for Packer to have an option available to the provisioner step to ignore every disconnection occuring during such provisioning step and simply wait for the provisioning command to return (i.e. Ansible for my case).

#### Use Case(s)

Let ansible handles completely the provisioning step, including machine reboots.

#### Potential configuration
Availability of a provisioner option to ignore communicator disconnection.

```
provisioner "ansible" {
playbook_file = "./playbook.yaml"
ignore_disconnect = True
}
```

#### Potential References

Attached to this issue I reported a MWE where the communicator disconnection is blocking the entire Packer process.

[packer-mwe.zip](https://github.com/user-attachments/files/18503764/packer-mwe.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.