title: What is the best practice for ensuring idempotency for downloading a binary with Ansible?
body: <p>I am writing an ansible playbook to install the Elastic stack with each component of the stack broken out into a separate role.  During the playbook execution I use the <strong>unarchive</strong> module to fetch the binary from the vendor and untar it.</p>
  
  <p>Something like:</p>
  
  <pre><code>- name: Install | Get binary
    unarchive:
      src: "{{ elasticsearch_download_url }}"
      dest: "{{ base_dir }}"
      remote_src: yes
  </code></pre>
  
  <p><br></p>
  
  <p>The problem I'm running into is idempotence in the downloading of the binary.  To my knowledge, true idempotence during the playbook run would be a bunch of <strong>"ok"</strong> responses and no <strong>"changed"</strong> responses.</p>
  
  <p>Is there a best practice when it comes to ensuring idempotence with downloading binaries?  I was thinking maybe a check for an existing install using a <strong>when:</strong> key, but I'm not 100% on that.</p>
  
  <p>Thanks for the help!</p>