zuul-jobs/roles/ensure-skopeo/tasks/Ubuntu-24.04.yaml
Clark Boylan 298354d2e3 Ombibus set of fixups for Ubuntu Noble
There are a number of updates we make for Ubuntu Noble in this commit.

1. Remove python2-dev from bindep for Noble as Noble appears to have no
   python2 runtime options.
2. Add libjpeg-dev to bindep for noble because Pillow doesn't build
   python3.12 wheels for Pillow<10 which we currently depend on. This
   means we need to build from source and that depends on libjpeg-dev.
3. We remove double bracket wrappers from ansible vars in ansible
   assertion blocks. Having them results in errors like:
     Conditional is marked as unsafe, and cannot be evaluated.
4. We update rust testing to explicitly install pkg-config before
   building python cryptography. This tool is required to build
   cryptography from source and is no longer being pulled in either
   by the base images or build-essential meta pacakge.
5. Add an Ubuntu-24.04 tasks file for the ensure-skopeo roles so that
   we try to install skopeo using distro packages or build from source
   and don't use Kubic which only has packages for old Ubuntu releases.

Change-Id: I388710ce40dc757ada4de819a9c3c59fc32fb07a
2024-05-23 10:54:36 -07:00

50 lines
1.2 KiB
YAML

- name: Install skopeo from packages
when: not ensure_skopeo_install_from_upstream
package:
name:
- skopeo
- uidmap
state: present
become: yes
- name: Install skopeo from upstream
when: ensure_skopeo_install_from_upstream
block:
- name: Install dependencies
become: yes
package:
name:
- libgpgme-dev
- libassuan-dev
- libbtrfs-dev
- libdevmapper-dev
- pkg-config
- build-essential
- golang
state: present
- name: Clone upstream source
git:
repo: https://github.com/containers/skopeo
dest: '{{ ansible_user_dir }}/skopeo'
version: '{{ ensure_skopeo_install_from_upstream_version }}'
- name: Build skopeo
command: 'make bin/skopeo'
args:
chdir: '{{ ansible_user_dir }}/skopeo'
- name: Install binary
become: yes
copy:
src: '{{ ansible_user_dir}}/skopeo/bin/skopeo'
dest: '/usr/local/bin/skopeo'
owner: root
group: root
mode: '0755'
remote_src: yes
- name: Test binary
command: '/usr/local/bin/skopeo --version'