From 8828d4e11c28da88d65e45014431361aabb0c3d5 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 21 Nov 2020 03:42:54 +0100 Subject: use delegation for vm/guest install and define --- roles/cloud/install/templates/hetzner_postinst.sh.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'roles/cloud/install/templates/hetzner_postinst.sh.j2') diff --git a/roles/cloud/install/templates/hetzner_postinst.sh.j2 b/roles/cloud/install/templates/hetzner_postinst.sh.j2 index ad701364..8f923313 100644 --- a/roles/cloud/install/templates/hetzner_postinst.sh.j2 +++ b/roles/cloud/install/templates/hetzner_postinst.sh.j2 @@ -33,8 +33,8 @@ mkdir -p -m 0700 /target/root/.ssh cat < /root/.ssh/authorized_keys {{ ssh_keys_root | join('\n') }} EOK -{% 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 +{% if ansible_port is defined %} +sed -e 's/^\(\s*#*\s*Port.*\)/Port {{ 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 #} -- cgit v1.2.3