diff --git a/Ansible/roles/debian_server/tasks/toolbox.yml b/Ansible/roles/debian_server/tasks/toolbox.yml index 1a8b2016c11c5f2ddee69cbb8a3d4618b70f81bd..0133d2b0f934e98036f2c7ae518adb5e07442a22 100644 --- a/Ansible/roles/debian_server/tasks/toolbox.yml +++ b/Ansible/roles/debian_server/tasks/toolbox.yml @@ -20,14 +20,8 @@ value: "1" - name: Install Podman from the Kubic repository - # yamllint disable-line rule:line-length - when: ansible_facts.distribution_release is in ["buster", "bionic", "focal", "hera", "odin"] + when: toolbox_podman_repo_base_url is defined block: - - name: Assertions - assert: - that: - - toolbox_podman_repo_base_url is defined - - name: Add the Podman repo key apt_key: state: present @@ -59,9 +53,21 @@ state: present update_cache: true -- name: Install Toolbox +- name: Install Toolbx from toolbox-build + # yamllint disable-line rule:line-length + when: ansible_facts.distribution_release is not in toolbox_distros_with_apt_package unarchive: dest: /usr/local/ remote_src: true # yamllint disable-line rule:line-length src: https://git.shore.co.il/shore/toolbox-build/-/jobs/artifacts/master/raw/toolbox.tar.gz?job=build + +- name: APT install Toolbx + # yamllint disable-line rule:line-length + when: ansible_facts.distribution_release is in toolbox_distros_with_apt_package + apt: + cache_valid_time: 3600 + name: + - podman-toolbox + state: present + update_cache: true diff --git a/Ansible/roles/debian_server/vars/main.yml b/Ansible/roles/debian_server/vars/main.yml index de0e88dbb958f1d49bf929c7383c0c970165b4d6..2ff2166e13da2114c65050e62e2173c7cb49b961 100644 --- a/Ansible/roles/debian_server/vars/main.yml +++ b/Ansible/roles/debian_server/vars/main.yml @@ -28,8 +28,12 @@ maintenance_tasks: command: mnpw --errors --warn -- needrestart -p frequency: daily -# Hera and Odin are ElementaryOS releases based on Ubuntu Bionic and Focal -# respectively. +# At the time of writing, the next versions of Debian and Ubuntu LTS (and thus +# the next version of ElementaryOS) have Podman and Toolbx packaged so the +# lists below should be pretty static and in time can be removed entirely. + +# Hera is an ElementaryOS release based on Ubuntu Bionic and Odin and Jólnir +# are ElementaryOS releases based on Ubuntu Focal. toolbox_podman_repo_base_url_mapping: # yamllint disable-line rule:line-length bionic: &bionic https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_18.04/ @@ -42,3 +46,15 @@ toolbox_podman_repo_base_url_mapping: toolbox_podman_repo_base_url: |- {{ toolbox_podman_repo_base_url_mapping[ansible_facts.distribution_release] }} + +toolbox_distros_without_apt_package: + # Debian releases before bookworm. + - bullseye + - buster + # Ubuntu releases before jammy. + - bionic + - focal + # ElementaryOS release before 7.0 (which is based on Ubuntu jammy). + - hera + - odin + - jolnir