block/rescue is not rescuing ?

Hi all,

im having trouble with the block/rescue functionality.

Here is my code:


- block:
- name: wget consul from artifactory
get_url:
url: '{{ consul_url }}'
checksum: 'sha256:{{ consul_sha256 }}'
dest: '{{ consul_home }}'
timeout: 5
register: downloaded_consul
rescue:
- name: wget consul to localhost
get_url:
url: '{{ consul_url }}'
checksum: 'sha256:{{ consul_sha256 }}'
dest: ./
register: wget_local
run_once: true
delegate_to: localhost
become: false

- name: copy zip file over
copy:
src: '{{ wget_local.dest }}'
dest: '{{ consul_home }}/'
register: copied_consul
tags:
- upgrade

- name: Extract consul executable files
unarchive:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
copy: false
with_items:
- src: '{{ consul_home }}/consul_{{ consul_version }}_linux_amd64.zip'
dest: '{{ consul_home }}'
when: (downloaded_consul|default({}))|changed or (copied_consul|default({}))|changed
register: consul_unarchive
tags:
- upgrade

so what i expect to happen is that if for some reason wget consul from artifactory does not complete for some hosts, it will execute the rescue block and download it locally and then upload it to the server.
If i run that playbook, im getting:


TASK [consul : wget consul from artifactory] ***********************************
fatal: [server2]: FAILED! => {"changed": false, "failed": true, "msg": "failed to create temporary content file: timed out"}
fatal: [client1]: FAILED! => {"changed": false, "failed": true, "msg": "failed to create temporary content file: timed out"}
changed: [server1]
changed: [server3]

TASK [consul : Extract consul executable files] ********************************
changed: [server1] => (item={u'dest': u'/var/lib/consul', u'src': u'/var/lib/consul/consul_0.7.3_linux_amd64.zip'})
ok: [server2 -> localhost]

which completely skips the rescue block after wget consul from artifactory fails.

Any ideas on whats happening here ? Am i using block/rescue wrong ?

Cheers


ansible --version
ansible 2.2.0.0
configured module search path = Default w/o overrides