Skip to content

Commit

Permalink
fix #239 , use python-style templating instead of Jinja in the ec2 lo…
Browse files Browse the repository at this point in the history
…gin_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: #239
  • Loading branch information
danielpodwysocki committed Feb 14, 2024
1 parent b48ead5 commit 55ae73e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/molecule_plugins/ec2/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)

Expand Down

0 comments on commit 55ae73e

Please sign in to comment.