Add ensure-skopeo role

Role copied and modified from ensure-podman

As focal doesn't exist for project atomic ppa [1]
Install is performed from opensuse repository only

[1] http://ppa.launchpad.net/projectatomic/ppa/ubuntu/dists/

Change-Id: I72fc2e68768664b80c39bd47295330131337d8b5
This commit is contained in:
Guillaume Chauvel 2021-05-25 09:53:13 +02:00
parent 0fcc5ff5ac
commit b517747623
9 changed files with 121 additions and 0 deletions

View File

@ -9,6 +9,7 @@ Container Roles
.. zuul:autorole:: ensure-kubernetes
.. zuul:autorole:: ensure-openshift
.. zuul:autorole:: ensure-podman
.. zuul:autorole:: ensure-skopeo
.. zuul:autorole:: pause-buildset-registry
.. zuul:autorole:: promote-docker-image
.. zuul:autorole:: pull-from-intermediate-registry

View File

@ -0,0 +1 @@
Install skopeo

View File

@ -0,0 +1,4 @@
- name: Install skopeo (RedHat)
become: true
package:
name: skopeo

View File

@ -0,0 +1,16 @@
- name: Add all repositories
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: Install skopeo
package:
name:
- skopeo
- uidmap
state: present
become: yes

View File

@ -0,0 +1,17 @@
- name: Add all repositories
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 skopeo
package:
name:
- skopeo
- uidmap
state: present
become: yes

View File

@ -0,0 +1,3 @@
- name: Not implemented
fail:
msg: Role not implemented on this platform yet

View File

@ -0,0 +1,10 @@
- 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"
- "default.yaml"
loop_control:
loop_var: zj_distro_os

View File

@ -0,0 +1,14 @@
- hosts: all
roles:
- ensure-skopeo
- hosts: all
tasks:
- name: Exercise skopeo
command: /usr/bin/skopeo -v
register: output
- name: Debug output
debug:
msg: '{{ output.stdout }}'

View File

@ -367,6 +367,21 @@
- test-playbooks/ensure-podman/.*
run: test-playbooks/ensure-podman/main.yaml
- job:
name: zuul-jobs-test-ensure-skopeo
description: |
Test the ensure-skopeo role
This job tests the ensure-skopeo role. It is not meant to be
used directly but rather run on changes to roles in the
zuul-jobs repo.
abstract: true
files:
- roles/ensure-skopeo/.*
- roles/ensure-package-repositories/.*
- test-playbooks/ensure-skopeo/.*
run: test-playbooks/ensure-skopeo/main.yaml
- job:
name: zuul-jobs-test-ensure-podman-centos-8
description: Tests ensure-podman role on centos-8
@ -394,6 +409,42 @@
- name: ubuntu-bionic
label: ubuntu-bionic
- job:
name: zuul-jobs-test-ensure-skopeo-centos-8
description: Tests ensure-skopeo role on centos-8
parent: zuul-jobs-test-ensure-skopeo
nodeset:
nodes:
- name: centos-8
label: centos-8
- job:
name: zuul-jobs-test-ensure-skopeo-fedora-32
description: Tests ensure-skopeo role on fedora-32
parent: zuul-jobs-test-ensure-skopeo
nodeset:
nodes:
- name: fedora-32
label: fedora-32
- job:
name: zuul-jobs-test-ensure-skopeo-ubuntu-bionic
description: Tests ensure-skopeo role on ubuntu-bionic
parent: zuul-jobs-test-ensure-skopeo
nodeset:
nodes:
- name: ubuntu-bionic
label: ubuntu-bionic
- job:
name: zuul-jobs-test-ensure-skopeo-ubuntu-focal
description: Tests ensure-skopeo role on ubuntu-focal
parent: zuul-jobs-test-ensure-skopeo
nodeset:
nodes:
- name: ubuntu-focal
label: ubuntu-focal
# -* AUTOGENERATED *-
# The following project section is autogenerated by
# tox -e update-test-platforms
@ -422,6 +473,10 @@
- zuul-jobs-test-ensure-podman-centos-8
- zuul-jobs-test-ensure-podman-fedora-32
- zuul-jobs-test-ensure-podman-ubuntu-bionic
- zuul-jobs-test-ensure-skopeo-centos-8
- zuul-jobs-test-ensure-skopeo-fedora-32
- zuul-jobs-test-ensure-skopeo-ubuntu-bionic
- zuul-jobs-test-ensure-skopeo-ubuntu-focal
gate:
jobs: *id001
periodic-weekly: