If the uri module fails (on account of the host being down etc) then
the jenkins_home_content dict will not yet be populated and Ansible
will fail with a "'dict object' has no attribute 'status'" error.
Thus, we need to check that the request was successful, regardless of
the HTTP status, before examining the status.
If the uri module fails (on account of the host being down etc) then the jenkins_home_content dict will not yet be populated and Ansible will fail with a "'dict object' has no attribute 'status'" error. Thus, we need to check that the request was successful, regardless of the HTTP status, before examining the status.
ping @emmetog, thanks!