From d0904a96a8a047733df8199ed7aaa64374669ddb Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 13 Nov 2022 22:03:45 +0100 Subject: [PATCH] Fix SSH port logic again --- roles/ubuntu_base/tasks/ssh.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/ubuntu_base/tasks/ssh.yml b/roles/ubuntu_base/tasks/ssh.yml index fa11cd1..b3b9890 100644 --- a/roles/ubuntu_base/tasks/ssh.yml +++ b/roles/ubuntu_base/tasks/ssh.yml @@ -3,6 +3,7 @@ wait_for: port: 19022 host: "{{ ansible_host }}" + search_regex: "OpenSSH" connect_timeout: 5 timeout: 10 become: false @@ -20,7 +21,7 @@ ssh_configured.state != "started")) and ansible_port != 2222 -- name: Change SSH port +- name: Change SSH port on host lineinfile: dest: "/etc/ssh/sshd_config" regexp: "^#?Port"