# would like to skip unzip if directory exist

**URL:** <https://forum.ansible.com/t/would-like-to-skip-unzip-if-directory-exist/35085>\
**Category:** Ansible Project\
**Created:** [April 30, 2021, 12:04am UTC](https://forum.ansible.com/t/would-like-to-skip-unzip-if-directory-exist/35085 "2021-04-30T00:04:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jyanga](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jyanga/32/8108_2.png) [@jyanga](https://forum.ansible.com/u/jyanga)\
**Post date:** [April 30, 2021, 12:04am UTC](https://forum.ansible.com/t/would-like-to-skip-unzip-if-directory-exist/35085/1 "2021-04-30T00:04:48Z")

</div>

Hi!

I would like to skip the unzip of my task if the directory already exists. Here are my info.

contents of playbook: install\_zip.yml

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [June 22, 2021, 1:52am UTC](https://forum.ansible.com/t/would-like-to-skip-unzip-if-directory-exist/35085/2 "2021-06-22T01:52:26Z")

</div>

Try

- name: decompress zip  
win\_unzip:  
dest: “{{ item.dstpath }}”  
src: “{{ item.abspath }}”  
with\_items: “{{ zip\_info }}”

when: ( ansible\_os\_family == “Windows” and not dir\_stat.stat.exists )

Chris
