hashicorp / hashicorp/packer-plugin-ansible

`ansible_ssh_extra_args` not taken into account when `use_proxy = false`

Open
#91 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Go
Stars
64
Forks
40
PR merge metrics
No merged PRs in 30d

Description

#### Overview of the Issue

The `ansible_ssh_extra_args` argument is not taken into account when `use_proxy = false`.

#### Reproduction Steps

Go to https://github.com/samuel-phan/packer-ansible-issue-ssh-extra-args
and clone the repo and follow the README.

You won't find any `ProxyJump` in the logs though we set it in the `ansible_ssh_extra_args`:

https://github.com/samuel-phan/packer-ansible-issue-ssh-extra-args/blob/main/packer.pkr.hcl#L65-L67

Enable the `use_proxy = true` and you'll find the `ProxyJump` in the SSH args.

### Plugin and Packer version

Packer v1.7.10
packer-plugin-amazon v1.0.8

### Simplified Packer Buildfile

https://github.com/samuel-phan/packer-ansible-issue-ssh-extra-args/blob/main/packer.pkr.hcl

### Operating system and Environment details

```
$ sw_vers
ProductName: macOS
ProductVersion: 11.6.3
BuildVersion: 20G415

$ uname -mrs
Darwin 20.6.0 x86_64

$ ansible --version
ansible [core 2.11.4]
config file = None
configured module search path = ['/Users/sphan02/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
ansible collection location = /Users/sphan02/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.9.10 (main, Jan 15 2022, 11:48:00) [Clang 13.0.0 (clang-1300.0.29.3)]
jinja version = 2.11.2
libyaml = True
```

### Log Fragments and crash.log files

https://gist.github.com/samuel-phan/0fdf4a976b237258f301245606dc16cb

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the linked repository and its packer.pkr.hcl lines 65-67, comparing logs with use_proxy set to false and true. Trace how ansible_ssh_extra_args is handled in each case; done means the configured ProxyJump appears in the SSH arguments when use_proxy is false as well.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible, go
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.