hashicorp / hashicorp/packer

Please provide a way to refresh my ssh connection, or let me login/logout

Open
#12,036 2 comments 24 reactions 0 assignees View on GitHub
enhancement reconnect
Dominant language
Go
Stars
15.8k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

#### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

Please search the existing issues for relevant feature requests, and use the
reaction feature
(https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
to add upvotes to pre-existing requests.

#### Description

I want to be able to edit the packer user's groups, then tell packer to refresh the ssh connection so that I don't have to do any hacky business to get my permissions -- I want to be able to tell packer to logout, and login.

#### Use Case(s)

I am building an EC2 image with a docker image on it. I have to run the docker commands as sudo.

#### Potential configuration

```
provisioner "shell" {
inline = [
"sudo usermod -a -G docker ec2-user"
]
}
# 2nd shell provisioner, that can be configured to refresh the connection
provisioner "shell" {
new_connection = true
inline = [
"docker run hello-world"
]
}

```

#### Potential References
This was brought up in an old thread of google groups.

https://groups.google.com/g/packer-tool/c/XPXwk7PgLcc

Contributor guide

Open the contributing guide

Research direction

No source files or tests are named. Start at the shell provisioner and SSH connection lifecycle, then trace how a provisioner could request the refresh or logout/login behavior described by new_connection; done means a later Docker command uses the updated group permissions without a workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.