Role fails after service start
Summary
When rocketchat service starts again (and is not restart task but after upgrgdaing to service
role from 1.4.0 → 1.5.0 ) role do not wait for application to become ready.
Steps to reproduce
- execute deploy playbook with service role - 1.4.0
- then execute the same playbook with service role - 1.5.0
Expected behavior
Playbook ends with success.
Actual behavior
Playbook fails on login into Rocket.Chat
task
Relevant logs and/or screenshots
TASK [service : add docker-rocketchat service] ************************************************************************
Thursday 18 April 2019 09:46:57 +0000 (0:00:00.076) 0:02:24.738 ********
changed: [rocketchat]
TASK [service : start the service] ************************************************************************************
Thursday 18 April 2019 09:46:58 +0000 (0:00:00.880) 0:02:25.619 ********
changed: [rocketchat]
TASK [rocketchat : restart service if necessary] **********************************************************************
Thursday 18 April 2019 09:47:27 +0000 (0:00:28.835) 0:02:54.455 ********
skipping: [rocketchat]
TASK [rocketchat : login into Rocket.Chat] ****************************************************************************
Thursday 18 April 2019 09:47:27 +0000 (0:00:00.058) 0:02:54.514 ********
fatal: [rocketchat]: FAILED! => {"changed": false, "content": "", "failed_when_result": true, "msg": "Status code was -1 and not [200]: Request failed: <urlopen error [Errno 111] Connection refused>", "redirected": false, "status": -1, "url": "http://127.0.0.1:80/api/v1/login"}
Possible fixes
Move service_restart
tasks to deploy.yml file and only restart service if necessary
task tag with when
'flag'