ansible-sshjail icon indicating copy to clipboard operation
ansible-sshjail copied to clipboard

Fix issues with quoting

Open austinhyde opened this issue 3 years ago • 3 comments

Fixes #34. There are some cases where quote stripping (needed when ansible would otherwise try to run sudo in a jail) would remove too little or too many quotes. This attempts to rectify this using shlex-based parsing (mostly).

austinhyde avatar Aug 15 '21 19:08 austinhyde

When renaming "reconnection_retries" back to "retries" in sshjail.py, I can execute my playbooks successfully, so I think the parser change works just fine now.

Still requesting change, so maybe the retries issue could also be resolved in here (+ address my nitpicking about trailing whitespace).

okay, so this change was due to https://github.com/ansible/ansible/commit/a2239d88191794f0f8f1d21c7a63ecd85ec4349e, which landed first in 2.11.3

I upgraded my local installation from 2.11.2 to 2.11.3 now and added an ansible minimum version requirement to my playbooks.

I also opened #37 to add a check to the module, so that there is a structured error message for others running into this.

grembo avatar Aug 16 '21 16:08 grembo

FWIW I'm having to apply this patch for Ansible 2.12. It looks like the fix was only applied on the 2.11 branch?

durin42 avatar Dec 20 '21 23:12 durin42

FWIW I'm having to apply this patch for Ansible 2.12. It looks like the fix was only applied on the 2.11 branch?

There is some confusion - the patch to sshjail (#34 or #36) is required in all cases, but while testing #36 I noticed that sshjail didn't work at all on certain versions of ansible (2.11.0, 2.11.1, and 2.11.2) due to a bug in those versions.

grembo avatar Dec 20 '21 23:12 grembo