summaryrefslogtreecommitdiff
path: root/roles/cloud/install/templates/hetzner_postinst.sh.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/cloud/install/templates/hetzner_postinst.sh.j2')
-rw-r--r--roles/cloud/install/templates/hetzner_postinst.sh.j24
1 files changed, 2 insertions, 2 deletions
diff --git a/roles/cloud/install/templates/hetzner_postinst.sh.j2 b/roles/cloud/install/templates/hetzner_postinst.sh.j2
index ac357db6..39a3fd7d 100644
--- a/roles/cloud/install/templates/hetzner_postinst.sh.j2
+++ b/roles/cloud/install/templates/hetzner_postinst.sh.j2
@@ -16,8 +16,8 @@ mkdir -p -m 0700 /target/root/.ssh
cat <<EOK > /root/.ssh/authorized_keys
{{ ssh_keys_root | join('\n') }}
EOK
-{% if hostvars[hostname].ansible_port is defined %}
-sed -e 's/^\(\s*#*\s*Port.*\)/Port {{ hostvars[hostname].ansible_port }}/' -i /etc/ssh/sshd_config
+{% if hostvars[install_hostname].ansible_port is defined %}
+sed -e 's/^\(\s*#*\s*Port.*\)/Port {{ hostvars[install_hostname].ansible_port }}/' -i /etc/ssh/sshd_config
{% endif %}
{# this is actually only needed on ubuntu bionic and beyond but should not hurt on other installations either #}