From c71cba48550522d455b6f9e2b5449cf59e65cea4 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Mon, 30 Oct 2023 17:19:48 -0300 Subject: [PATCH] tests/e2e: installs containerd 1.7 on Ubuntu 22.04 On Ubuntu 22.04 installs docker from the distro and consequently containerd version 1.7. This ways we cover the default installation case where INSTALL_OFFICIAL_CONTAINERD=false. Signed-off-by: Wainer dos Santos Moschetta --- tests/e2e/ansible/install_containerd.yml | 8 +++++--- tests/e2e/ansible/install_docker.yml | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/tests/e2e/ansible/install_containerd.yml b/tests/e2e/ansible/install_containerd.yml index 5bf38d96..4f6d1021 100644 --- a/tests/e2e/ansible/install_containerd.yml +++ b/tests/e2e/ansible/install_containerd.yml @@ -9,9 +9,9 @@ - hosts: all become: yes tasks: - - name: Install containerd.io from distro + - name: Install containerd from distro package: - name: "containerd.io" + name: "{{ 'containerd.io' if ansible_distribution_version != '22.04' else 'containerd' }}" state: present # The docker package overwrite the /etc/containerd/config.toml installed # by the containerd.io package. As a result we are hit by the following @@ -26,7 +26,9 @@ # Those issues are solved by re-generating the containerd configuration # file with its defaults. - name: Re-create containerd config - shell: containerd config default > /etc/containerd/config.toml + shell: | + mkdir -p /etc/containerd/ + containerd config default > /etc/containerd/config.toml args: executable: /bin/bash - name: Restart containerd service diff --git a/tests/e2e/ansible/install_docker.yml b/tests/e2e/ansible/install_docker.yml index c96cd41a..9e3572d7 100644 --- a/tests/e2e/ansible/install_docker.yml +++ b/tests/e2e/ansible/install_docker.yml @@ -12,7 +12,7 @@ shell: command -v docker >/dev/null 2>&1 register: docker_exist ignore_errors: yes -- name: Handle docker installation on Ubuntu +- name: Handle docker installation on Ubuntu 20.04 block: - name: Install docker dependencies package: @@ -45,7 +45,20 @@ name: docker state: present # TODO: add regular non-root users to docker group - when: docker_exist.rc != 0 and ansible_distribution == "Ubuntu" + when: docker_exist.rc != 0 and ansible_distribution == "Ubuntu" and ansible_distribution_version == "20.04" +- name: Handle docker installation on Ubuntu 22.04 + block: + - name: Install docker packages + package: + name: + - docker.io + - docker-buildx + state: present + - name: Create the docker group + group: + name: docker + state: present + when: docker_exist.rc != 0 and ansible_distribution == "Ubuntu" and ansible_distribution_version == "22.04" - name: Handle docker installation on CentOS. block: - name: Install yum-utils