You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes your VMs are behind a jump host (or a few) - or you just need to add extra SSH arguments.
After a lot of trial-and-error and digging through the codebases of both molecule-proxmox and molecule, I managed the following in the molecule.yml file, which mostly works:
This works for molecule create, molecule destroy, and molecule converge just fine, which is great.
The problem is molecule login doesn't use the jump host, opting to connect to the endpoint directly:
WARNING Driver molecule-proxmox does not provide a schema.
INFO Running default > login
ssh: connect to host 10.100.40.109 port 22: Connection refused
Note that the Connection refused is due to a REJECT rule in my firewall for any RFC1918 address that isn't in a known subnet. I have confirmed that molecule login attempts to connect directly to the endpoint IP, bypassing any request to use the jump host.
Official support for ansible_ssh_common_args and ansible_ssh_extra_args would be great!
@IamLunchbox managed to dig further and found the following:
molecule login (opposed to other steps of molecule) doesn't use the ansible python class to execute the login. This probably must be done because an interactive connection with a host is not possible in ansible.
Your settings are not picked up by molecule login here, because molecule login does only
use a hardcoded set of options to connect. When I debugged molecule the options were:
Prerequisites
pip check
does not report any conflictsEnvironment
molecule 6.0.3 using python 3.9
ansible:2.15.13
default:6.0.3 from molecule
molecule-proxmox:0.9.0 from molecule_proxmox
What happened
Referencing meffie/molecule-proxmox#27
Sometimes your VMs are behind a jump host (or a few) - or you just need to add extra SSH arguments.
After a lot of trial-and-error and digging through the codebases of both molecule-proxmox and molecule, I managed the following in the
molecule.yml
file, which mostly works:This works for
molecule create
,molecule destroy
, andmolecule converge
just fine, which is great.The problem is
molecule login
doesn't use the jump host, opting to connect to the endpoint directly:Note that the
Connection refused
is due to a REJECT rule in my firewall for any RFC1918 address that isn't in a known subnet. I have confirmed thatmolecule login
attempts to connect directly to the endpoint IP, bypassing any request to use the jump host.Official support for
ansible_ssh_common_args
andansible_ssh_extra_args
would be great!@IamLunchbox managed to dig further and found the following:
Reproducing example
The text was updated successfully, but these errors were encountered: