From e3327efd382009ceb820da90c43e6138a6ec0c20 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Wed, 4 Aug 2021 02:30:40 +0000 Subject: [PATCH] Fix install podman error on Ubuntu aarch64 Bionic The official podman ubuntu install guide[1] tells to install podman from Kubic project repo for ubuntu Bionic and Focal. And project atomic PPA repo[2] is deprecated. But Kubic repo only provides x86_64 deb packages for Bionic. For non x86_64 platforms use project atomic PPA repo on Bionic. Also add a job zuul-jobs-test-ensure-podman-ubuntu-focal. [1] https://podman.io/getting-started/installation [2] https://launchpad.net/~projectatomic/+archive/ubuntu/ppa Change-Id: I402adf1866e4bb8f3b388216bc48b9927e1388b1 --- roles/ensure-podman/tasks/Ubuntu-18.04.yaml | 34 +++++++++++++++++++++ roles/ensure-podman/tasks/Ubuntu.yaml | 4 +-- roles/ensure-podman/tasks/main.yaml | 1 + zuul-tests.d/container-roles-jobs.yaml | 11 +++++++ 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 roles/ensure-podman/tasks/Ubuntu-18.04.yaml diff --git a/roles/ensure-podman/tasks/Ubuntu-18.04.yaml b/roles/ensure-podman/tasks/Ubuntu-18.04.yaml new file mode 100644 index 000000000..6e3b0754e --- /dev/null +++ b/roles/ensure-podman/tasks/Ubuntu-18.04.yaml @@ -0,0 +1,34 @@ +- name: Add kubic project repository + when: ansible_architecture == "x86_64" + include_role: + name: ensure-package-repositories + vars: + repositories_keys: + - url: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/Release.key" + repositories_list: + - repo: "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/ /" + +- name: Add project atomic PPA repository + when: ansible_architecture != "x86_64" + include_role: + name: ensure-package-repositories + vars: + repositories_list: + - repo: ppa:projectatomic/ppa + +- name: Install podman + package: + name: + - podman + - uidmap + - slirp4netns + state: present + become: yes + +# NOTE(pabelanger): Remove default registries.conf file, so we can manage it +# ourself. It could have v1 syntax, which doesn't work with v2. +- name: Remove /etc/containers/registries.conf + become: true + file: + state: absent + path: /etc/containers/registries.conf diff --git a/roles/ensure-podman/tasks/Ubuntu.yaml b/roles/ensure-podman/tasks/Ubuntu.yaml index 5328f36d9..b4418d76c 100644 --- a/roles/ensure-podman/tasks/Ubuntu.yaml +++ b/roles/ensure-podman/tasks/Ubuntu.yaml @@ -1,11 +1,10 @@ -- name: Add all repositories +- name: Add kubic project repository include_role: name: ensure-package-repositories vars: repositories_keys: - url: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/Release.key" repositories_list: - - repo: ppa:projectatomic/ppa - repo: "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/ /" - name: Install podman @@ -14,6 +13,7 @@ - podman - uidmap - slirp4netns + - fuse-overlayfs state: present become: yes diff --git a/roles/ensure-podman/tasks/main.yaml b/roles/ensure-podman/tasks/main.yaml index 6b471c4ba..a82486cc8 100644 --- a/roles/ensure-podman/tasks/main.yaml +++ b/roles/ensure-podman/tasks/main.yaml @@ -1,6 +1,7 @@ - name: Find distribution installation include_tasks: "{{ zj_distro_os }}" with_first_found: + - "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml" - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yaml" - "{{ ansible_distribution }}.yaml" - "{{ ansible_os_family }}.yaml" diff --git a/zuul-tests.d/container-roles-jobs.yaml b/zuul-tests.d/container-roles-jobs.yaml index fffba2dd3..d56506a47 100644 --- a/zuul-tests.d/container-roles-jobs.yaml +++ b/zuul-tests.d/container-roles-jobs.yaml @@ -412,6 +412,15 @@ - name: ubuntu-bionic label: ubuntu-bionic +- job: + name: zuul-jobs-test-ensure-podman-ubuntu-focal + description: Tests ensure-podman role on ubuntu-focal + parent: zuul-jobs-test-ensure-podman + nodeset: + nodes: + - name: ubuntu-focal + label: ubuntu-focal + - job: name: zuul-jobs-test-ensure-skopeo-centos-8 description: Tests ensure-skopeo role on centos-8 @@ -476,6 +485,7 @@ - zuul-jobs-test-ensure-podman-centos-8 - zuul-jobs-test-ensure-podman-fedora-34 - zuul-jobs-test-ensure-podman-ubuntu-bionic + - zuul-jobs-test-ensure-podman-ubuntu-focal - zuul-jobs-test-ensure-skopeo-centos-8 - zuul-jobs-test-ensure-skopeo-fedora-34 - zuul-jobs-test-ensure-skopeo-ubuntu-bionic @@ -501,6 +511,7 @@ - zuul-jobs-test-ensure-kubernetes-crio - zuul-jobs-test-ensure-podman-centos-8 - zuul-jobs-test-ensure-podman-ubuntu-bionic + - zuul-jobs-test-ensure-podman-ubuntu-focal - zuul-jobs-test-ensure-skopeo-centos-8 - zuul-jobs-test-ensure-skopeo-fedora-34 - zuul-jobs-test-ensure-skopeo-ubuntu-bionic