From 659fa0eddc36506666b88c94f7a966c06e57ff4f Mon Sep 17 00:00:00 2001 From: Maxime Leroy <19607336+maxime1907@users.noreply.github.com> Date: Fri, 3 Mar 2023 03:24:58 +0100 Subject: [PATCH] feat(contrib/terraform): support custom ssh port (#9836) --- contrib/terraform/terraform.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/terraform/terraform.py b/contrib/terraform/terraform.py index 03a6785cc..0c9c287b4 100755 --- a/contrib/terraform/terraform.py +++ b/contrib/terraform/terraform.py @@ -316,7 +316,9 @@ def openstack_host(resource, module_name): # attrs specific to Ansible if 'metadata.ssh_user' in raw_attrs: - attrs['ansible_ssh_user'] = raw_attrs['metadata.ssh_user'] + attrs['ansible_user'] = raw_attrs['metadata.ssh_user'] + if 'metadata.ssh_port' in raw_attrs: + attrs['ansible_port'] = raw_attrs['metadata.ssh_port'] if 'volume.#' in list(raw_attrs.keys()) and int(raw_attrs['volume.#']) > 0: device_index = 1