From b311fc8236fca62f5eda3d6566511915fbc1489d Mon Sep 17 00:00:00 2001 From: mg Date: Fri, 22 Oct 2021 15:39:29 +0200 Subject: [PATCH] ssh: listen port als variable (#230) Co-authored-by: Michael Grote Reviewed-on: https://git.mgrote.net/mg/ansible/pulls/230 Co-authored-by: mg Co-committed-by: mg --- roles/mgrote.ssh/templates/pve.j2 | 2 +- roles/mgrote.ssh/templates/ubuntu.j2 | 2 +- roles/mgrote.ssh/vars/pve.yml | 1 + roles/mgrote.ssh/vars/ubuntu.yml | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/mgrote.ssh/templates/pve.j2 b/roles/mgrote.ssh/templates/pve.j2 index 6ad591e4..ff869096 100644 --- a/roles/mgrote.ssh/templates/pve.j2 +++ b/roles/mgrote.ssh/templates/pve.j2 @@ -9,7 +9,7 @@ # possible, but leave them commented. Uncommented options override the # default value. -#Port 22 +Port {{ ssh_listen_port }} #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: diff --git a/roles/mgrote.ssh/templates/ubuntu.j2 b/roles/mgrote.ssh/templates/ubuntu.j2 index c1879373..80d45ee0 100644 --- a/roles/mgrote.ssh/templates/ubuntu.j2 +++ b/roles/mgrote.ssh/templates/ubuntu.j2 @@ -11,7 +11,7 @@ Include /etc/ssh/sshd_config.d/*.conf -#Port 22 +Port {{ ssh_listen_port }} #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: diff --git a/roles/mgrote.ssh/vars/pve.yml b/roles/mgrote.ssh/vars/pve.yml index eb834eaa..5a209de1 100644 --- a/roles/mgrote.ssh/vars/pve.yml +++ b/roles/mgrote.ssh/vars/pve.yml @@ -3,3 +3,4 @@ ssh_password_authentication: "yes" ssh_print_motd: "no" ssh_print_lastlog: "no" + ssh_listen_port: "22" diff --git a/roles/mgrote.ssh/vars/ubuntu.yml b/roles/mgrote.ssh/vars/ubuntu.yml index 7076f225..3903358c 100644 --- a/roles/mgrote.ssh/vars/ubuntu.yml +++ b/roles/mgrote.ssh/vars/ubuntu.yml @@ -3,3 +3,4 @@ ssh_password_authentication: "no" ssh_print_motd: "no" ssh_print_lastlog: "no" + ssh_listen_port: "22"