From 6b106cce38106e7beb9db623a9d98784cb8bbc86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Thu, 30 Dec 2021 15:39:08 +0000 Subject: ansible_port: Add ssh port switch to network roles --- roles/sshd/tasks/main.yml | 2 +- roles/sshd/templates/sshd_config.j2 | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'roles/sshd') diff --git a/roles/sshd/tasks/main.yml b/roles/sshd/tasks/main.yml index 54ef9c2..f1af386 100644 --- a/roles/sshd/tasks/main.yml +++ b/roles/sshd/tasks/main.yml @@ -17,6 +17,6 @@ - name: check ssh connection wait_for: - port: 22 + port: "{{ ansible_port }}" delay: 1 state: started diff --git a/roles/sshd/templates/sshd_config.j2 b/roles/sshd/templates/sshd_config.j2 index 534ea39..f40e160 100644 --- a/roles/sshd/templates/sshd_config.j2 +++ b/roles/sshd/templates/sshd_config.j2 @@ -1,5 +1,8 @@ # managed by Ansible +# network +Port {{ ansible_port }} + # security PermitRootLogin yes MaxAuthTries 6 -- cgit v1.2.3