Skip to content

Commit

Permalink
tests/e2e: installs containerd 1.7 on Ubuntu 22.04
Browse files Browse the repository at this point in the history
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 <wainersm@redhat.com>
  • Loading branch information
wainersm authored and fidencio committed Nov 3, 2023
1 parent dca203c commit c71cba4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
8 changes: 5 additions & 3 deletions tests/e2e/ansible/install_containerd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 15 additions & 2 deletions tests/e2e/ansible/install_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c71cba4

Please sign in to comment.