• В конце добавить 3 таска
-
name: wait 2 minutes for webserver to start shell: 'curl --head --silent "https://{{ inventory_hostname }}/"' register: result ignore_errors: True async: 120 poll: 1 failed_when: false
-
name: fail if response is not 200 fail: msg="Cannot get 200 status from https://{{ inventory_hostname }}/" when: result.stdout.find("200") == -1
-
name: check response header contains 200 debug: msg="https://{{ inventory_hostname }}/ is up and running" when: result.stdout.find('200 Connection Established') != -1