ansible-sshjail
ansible-sshjail copied to clipboard
Exceptions after upgrading to ansible 4.x
Hi,
I'm posting this more as a "knowledge base entry" than anything else, because I managed to get everything working again. I hope it helps someone who gets stuck in the same situation (I propose to close it after both issues are addressed sshjail's code).
I've been very lazy with upgrading, so after finally switching to ansible 4.x, I hit two bumps. Note that I didn't change any configuration or ansible data though.
First one:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'Requested entry (plugin_type: connection plugin: sshjail setting: timeout ) was not defined in configuration.'
fatal: [...]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}
As it turns out, this issue is already fixed in #32. I used that fork and the error was gone...
... leading me to the second one:
File "[...]/plugins/connection/sshjail.py", line 449, in _copy_file
copycmd = plugin.build_become_command(' '.join(['cp', from_file, to_file]), shell)
AttributeError: 'NoneType' object has no attribute 'build_become_command'
fatal: [...]: FAILED! => {
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
This issue is already addressed in #30. I'm in the same situation: Ansible sshs to root@jailhost so never needed any become in the first place. It would be cool if this worked like before, but the workaround of configuring become=true, become_method=su (as documented in readme) helped.
That's all.
And thanks a lot for this wonderful plugin. It keeps my jail frankenstein zoo alive! :-)
Thanks for the patch, that helped me. I also needed #34 applied for it to work properly though.