From 277ac3d77d4eeae1c5cb0988bab3bd5f73ce2bab Mon Sep 17 00:00:00 2001 From: Anton Strogonoff Date: Fri, 29 Mar 2019 21:15:14 +0800 Subject: [PATCH] fix: Use wait_for_connection to avoid failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With preexisting wait_for implementation, deployment to Ubuntu on Lightsail failed with a connection reset error on this task. It appears that Ansible’s wait_for_connection is the recommended way. I have successfully gotten past this task after this change, however I’d appreciate more eyes on this. --- roles/common/tasks/ubuntu.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/roles/common/tasks/ubuntu.yml b/roles/common/tasks/ubuntu.yml index a37a8c00..ee062a6c 100644 --- a/roles/common/tasks/ubuntu.yml +++ b/roles/common/tasks/ubuntu.yml @@ -25,12 +25,8 @@ ignore_errors: true - name: Wait until SSH becomes ready... - local_action: - module: wait_for - port: 22 - host: "{{ inventory_hostname }}" - search_regex: OpenSSH - delay: 10 + wait_for_connection: + delay: 20 timeout: 320 when: reboot_required is defined and reboot_required.stdout == 'required' become: false