alan-turing-institute / data-safe-haven

https://data-safe-haven.readthedocs.io
BSD 3-Clause "New" or "Revised" License
57 stars 15 forks source link

Replace install_deb script with ansible commands #2095

Closed jemrobinson closed 1 day ago

jemrobinson commented 1 month ago

:white_check_mark: Checklist

:strawberry: Suggested change

Replace the install_deb.sh script with native Ansible

:steam_locomotive: How could this be done?

Suggestion from #2093

    - name: Install deb packages
      tags: apt
      block:
        - ansible.builtin.stat:
            path: "{{ item.creates }}"
          register: app

        - ansible.builtin.get_url:
            url: "{{ item.source }}"
            dest: /tmp/debfile.deb
            checksum: "{{ item.checksum }}"
          when: not app.exists

        - ansible.builtin.apt:
            deb: /tmp/debfile.deb
            state: present
          when: not app.exists
      loop: "{{ deb_packages[ansible_facts.distribution_release] }}"