summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2025-11-16 00:24:24 +0100
committerEgor Tensin <egor@tensin.name>2025-11-16 01:48:53 +0100
commitb2e38594fa27b98a76c84df09989b15c05d43604 (patch)
treee9c84058e66374a6adf905d1c1e548e520ea93f6
parentsshd: enable systemd service (diff)
downloadinfra-ansible-b2e38594fa27b98a76c84df09989b15c05d43604.tar.gz
infra-ansible-b2e38594fa27b98a76c84df09989b15c05d43604.zip
sshd: port 22 by default
-rw-r--r--roles/sshd/templates/sshd_config.j22
1 files changed, 1 insertions, 1 deletions
diff --git a/roles/sshd/templates/sshd_config.j2 b/roles/sshd/templates/sshd_config.j2
index 6303d83..3b12821 100644
--- a/roles/sshd/templates/sshd_config.j2
+++ b/roles/sshd/templates/sshd_config.j2
@@ -2,7 +2,7 @@
# Parameters that have sane defaults on Debian 11 are omitted.
-{% set ssh_port = hostvars[inventory_hostname].ansible_port %}
+{% set ssh_port = hostvars[inventory_hostname].ansible_port | default(22) %}
{% set ssh_user = hostvars[inventory_hostname].ansible_user %}
{% set groups = [ssh_user] + sshd_allowed_groups %}