Эх сурвалжийг харах

Cleanup the way to declare the ssh ports to listen on

Emmanuel Bouthenot 10 жил өмнө
parent
commit
90b5d102a8

+ 2 - 1
roles/common/defaults/main.yml

@@ -39,7 +39,8 @@ with_postfix: False
 with_mail_aliases: False
 
 with_ssh: True
-ssh_port: 22
+ssh_ports:
+  - 22
 ssh_ecdsa_key: True
 ssh_usedns: True
 

+ 1 - 8
roles/common/templates/ssh/sshd_config.j2

@@ -6,16 +6,9 @@
 # See the sshd_config(5) manpage for details
 
 # What ports, IPs and protocols we listen for
-{% if ssh_port is defined %}
-Port {{ ssh_port }}
-{% else %}
-Port 22
-{% endif %}
-{% if ssh_ports_extra is defined %}
-{% for port in ssh_ports_extra %}
+{% for port in ssh_ports %}
 Port {{ port }}
 {% endfor %}
-{% endif %}
 
 # Use these options to restrict which interfaces/protocols sshd will bind to
 #ListenAddress ::