# Install kiwix android app apk for downloading
- name: Create {{ doc_root }}{{ kiwix_apk_url }} directory
  file:
    path: "{{ doc_root }}{{ kiwix_apk_url }}"
    state: directory

- name: Download kiwix.apk to {{ doc_root }}{{ kiwix_apk_url }}
  get_url:
    url: "{{ kiwix_apk_src }}"    # e.g. https://download.kiwix.org/release/kiwix-android/kiwix.apk formerly kiwix-3.5.0.apk
    dest: "{{ doc_root }}{{ kiwix_apk_url }}"
    timeout: "{{ download_timeout }}"

- name: Symlink {{ doc_root }}{{ kiwix_apk_url }}/zims -> {{ iiab_zim_path }}/content
  file:
    src: "{{ iiab_zim_path }}/content"              # /library/zims/content
    path: "{{ doc_root }}{{ kiwix_apk_url }}/zims"  # /library/www/html/software/kiwix/zims
    state: link
