---

- name: DOWNLOAD | CREATE DOWNLOAD CACHE DIRECTORY
  # =====================================================================
  action: file
  sudo: false
  delegate_to: 127.0.0.1
  args:
    path: "{{download_cache}}/tomcat-8/tomcat-core"
    state: "directory"

- name: DOWNLOAD | ARCHIVE
  # =====================================================================
  action: get_url
  sudo: false
  delegate_to: 127.0.0.1
  args:
      url:  "{{apache_tomcat_download_url}}"
      dest: "{{download_cache}}/tomcat-8/tomcat-core/{{apache_tomcat_download_archive_name}}"
  register:
      apache_tomcat_download_changed

- name: DOWNLOAD | DETERMINE MD5SUM
  # =====================================================================
  action: stat
  sudo: false
  delegate_to: 127.0.0.1
  args:
      path: "{{download_cache}}/tomcat-8/tomcat-core/{{apache_tomcat_download_archive_name}}"
  register: apache_tomcat_download_stat
  when: apache_tomcat_download_changed.changed

- name: DOWNLOAD | CHECK MD5SUM
  # =====================================================================
  sudo: false
  action: assert
  delegate_to: 127.0.0.1
  args:
      that: apache_tomcat_download_stat.stat.md5 == "{{apache_tomcat_download_archive_md5}}"
  when: apache_tomcat_download_changed.changed

---

- name: DOWNLOAD | CREATE DOWNLOAD CACHE DIRECTORY
  # =====================================================================
  action: file
  sudo: false
  delegate_to: 127.0.0.1
  args:
    path: "{{download_cache}}/tomcat-8/tomcat-core"
    state: "directory"

- name: DOWNLOAD | ARCHIVE
  # =====================================================================
  action: get_url
  sudo: false
  delegate_to: 127.0.0.1
  args:
      url:  "{{apache_tomcat_download_url}}"
      dest: "{{download_cache}}/tomcat-8/tomcat-core/{{apache_tomcat_download_archive_name}}"
      # :TODO: Ansible 2.0 - Enable
      # checksum: "{{tomcat_checksum}}"
  register:
      apache_tomcat_download_changed


Remove script based checksum check
apache/tomcat-8: Remove script based checksum check

Will be enabled with ansible 2.0 again.
