From 55ae73e33fc51f6cd929d41b1b186f98dfbbaddd Mon Sep 17 00:00:00 2001 From: Daniel Podwysocki <48068081+danielpodwysocki@users.noreply.github.com> Date: Wed, 14 Feb 2024 18:59:33 +0100 Subject: [PATCH] fix #239 , use python-style templating instead of Jinja in the ec2 login_cmd_template This file assumes Jinja templating for the port parameter and passes a Jinja-style "{{ port }}". https://github.com/ansible/molecule/blob/main/src/molecule/command/login.py#L105 When it reaches molecule, it is subsituted in this file and is done by python calling `.format()` on the string. That causes it to not render correctly and gives users issues running molecule login. ref: https://github.com/ansible-community/molecule-plugins/issues/239 --- src/molecule_plugins/ec2/driver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/molecule_plugins/ec2/driver.py b/src/molecule_plugins/ec2/driver.py index fdefc810..53355b2c 100644 --- a/src/molecule_plugins/ec2/driver.py +++ b/src/molecule_plugins/ec2/driver.py @@ -195,10 +195,10 @@ def login_cmd_template(self): connection_options = " ".join(self.ssh_connection_options) return ( - "ssh {{address}} " - "-l {{user}} " - "-p {{port}} " - "-i {{identity_file}} " + "ssh {address} " + "-l {user} " + "-p {port} " + "-i {identity_file} " f"{connection_options}" )