ansible-sshjail
ansible-sshjail copied to clipboard
Fix issues with quoting
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).
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.
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?
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.