---

- name: gather ansible_pkg_mgr
  setup:
    gather_subset: "!min,pkg_mgr"
  when: ansible_pkg_mgr is not defined

- name: Install package installation script
  template:
    src: install_packages.sh.j2
    dest: "{{ working_dir }}/install_packages.sh"
    mode: 0755

- name: Run the package installation script
  shell: >
    set -o pipefail &&
    {{ working_dir }}/install_packages.sh 2>&1 {{ timestamper_cmd }} >
    {{ working_dir }}/install_packages.sh.log
