Commit 04ef2210 authored by nimrod's avatar nimrod
Browse files

ansible: debian_server role update.

Update the role to support Debian Trixie (13). Remove support for older
versions (for Debian Bullseye (11), Ubuntu 22.04 (Jammy) and
ElementaryOS 6 or older).
parent 7e433ac9
Loading
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -7,14 +7,21 @@
      - ansible_facts.service_mgr == "systemd"

- name: Enable the backports repo
  loop:
  ansible.builtin.deb822_repository:
    components:
      - main
      - contrib
      - non-free
      - non-free-firmware
    enabled: true
    name: backports
    signed_by: /usr/share/keyrings/debian-archive-keyring.gpg
    state: present
    suites: "{{ ansible_facts.distribution_release }}-backports"
    types:
      - deb
      - deb-src
  ansible.builtin.apt_repository:
    # yamllint disable-line rule:line-length
    repo: '{{ item }} http://deb.debian.org/debian {{ ansible_facts.distribution_release }}-backports main contrib non-free non-free-firmware'
    state: present
    update_cache: true
    uris: http://deb.debian.org/debian

- name: Set normal priority for the backports repo
  ansible.builtin.copy:
@@ -83,6 +90,7 @@
    - always

- name: Make /tmp a tmpfs mount
  when: ansible_facts.distribution_major_version|int < 13
  ansible.posix.mount:
    fstype: tmpfs
    name: /tmp
+1 −39
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
    - /etc/subuid
  ansible.builtin.copy:
    content: |
      nimrod:100000:65536
      {{ ansible_user_id }}:100000:65536
    dest: |-
      {{ item }}
    group: root
@@ -19,33 +19,6 @@
    state: present
    value: "1"

- name: Install Podman from the Kubic repository
  # yamllint disable-line rule:line-length
  when: ansible_facts.distribution_release in toolbox_podman_repo_base_url_mapping
  block:
    - name: Add the Podman repo key
      ansible.builtin.apt_key:
        state: present
        url: |-
          {{ toolbox_podman_repo_base_url }}/Release.key

    - name: Add the Podman repo
      ansible.builtin.apt_repository:
        repo: |-
          deb {{ toolbox_podman_repo_base_url }} /
        state: present
        update_cache: true

    - name: Install newer libseccomp2 from the backports repository
      when: ansible_facts.distribution_release == "buster"
      ansible.builtin.apt:
        cache_valid_time: 3600
        default_release: buster-backports
        name:
          - libseccomp2
        state: present
        update_cache: true

- name: APT install prerequisites
  ansible.builtin.apt:
    cache_valid_time: 3600
@@ -58,18 +31,7 @@
    state: present
    update_cache: true

- name: Install Toolbx from toolbox-build
  # yamllint disable-line rule:line-length
  when: ansible_facts.distribution_release is in toolbox_distros_without_apt_package
  ansible.builtin.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 not in toolbox_distros_without_apt_package
  ansible.builtin.apt:
    cache_valid_time: 3600
    name:
+0 −31
Original line number Diff line number Diff line
@@ -28,36 +28,5 @@ maintenance_tasks:
    command: mnpw --errors --warn -- needrestart -p
    frequency: daily

# 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/
  # yamllint disable-line rule:line-length
  buster: https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/
  # yamllint disable-line rule:line-length
  focal: &focal https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/
  hera: *bionic
  odin: *focal

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

docker_daemon_config:
  storage-driver: overlay2