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"