---
-
  name: "Checking if Genesis Apps are installed: {{ genesis_packages }}"
  register: genesis_packages_installed_check
  ansible.builtin.stat:
    path: "{{ completed_dir }}/genesis_packages_installed_check"
    get_md5: false

-
  name: "Waiting for 15 seconds to let Domino fully startup from previous tasks"
  when: not genesis_packages_installed_check.stat.exists
  ansible.builtin.pause:
    seconds: 15

-
  name: "Installing Genesis Applications"
  ansible.builtin.shell: domino cmd "tell genesis install {{ item }}" 20
  when: not genesis_packages_installed_check.stat.exists
  become: true
  args:
    executable: "/bin/bash"
  register: domino_genesis_applications
  with_items:
    - "{{ genesis_packages }}"

-
  name: "Debugging Genesis Application Installation"
  when: ( genesis_packages_debug or debug_all ) and not genesis_packages_installed_check.stat.exists
  ansible.builtin.debug:
    msg: "{{ domino_genesis_applications }}"

-
  name: "Marking all Genesis packages as installed"
  when: not genesis_packages_installed_check.stat.exists
  ansible.builtin.file:
    mode: '0644'
    path: "{{ item }}"
    state: touch
  with_items:
    - "{{ completed_dir }}/genesis_packages_installed_check"
