Clark Boylan 7bd42d37c4 Fixup CI jobs
Several things have bit rotted in here that we need to take care of.

First is that we updated the default nodeset to Noble which breaks our
ability to install Pillow<10 for blockdiag. To fix this we need to
install libjpeg-dev so that we can build a Pillow wheel locally during
testing.

Next old ansible-lint doesn't run on Noble's python3.12. We bump up
Ansible lint to a modern version that matches Zuul's current default
Ansible. We also stop installing zuul to get zuul_console and
zuul_return and instead simply mock them in the linter. To make this
work we have to drop the ansible-playbook syntax check run which is fine
because ansible-lint runs this too, but when done via ansible-lint the
mocked modules are respected [0].

Finally we have to clean up/ignore some of the new linter
warnings/errors.

[0] https://ansible.readthedocs.io/projects/lint/rules/syntax-check/

Change-Id: Ia0e936fefc9e2b0f2fa614c93a2f168e14b2825b
2024-09-19 14:18:01 -07:00

39 lines
1.2 KiB
YAML

- hosts: localhost
tasks:
- name: Check execution context
when: "zuul.tag is not defined"
fail:
msg: "This playbook must be run in a tag-based pipeline (e.g., 'release')."
- name: Write root marker
include_role:
name: write-root-marker
vars:
root_marker_dir: "{{ zuul.executor.log_root }}/docs"
- name: Select target configuration
set_fact:
target_dict: "{{ afs.targets.tag }}"
- name: Set target path
set_fact:
target_dir: "{{ target_dict.path.format(zuul=zuul) }}"
- name: Adjust target path
when: "target_dict.regex is defined"
set_fact:
target_dir: "{{ target_dir | regex_replace(target_dict.regex.pattern, target_dict.regex.sub) }}"
- name: Get an AFS token
include_role:
name: create-afs-token
- name: Create publication directory
file:
path: "{{ target_dir }}"
state: directory
mode: "0755"
- name: Upload to AFS
include_role:
name: upload-afs-roots
vars:
afs_source: "{{ zuul.executor.log_root }}/docs/"
afs_target: "{{ target_dir }}"
- name: Destroy AFS token
include_role:
name: destroy-afs-token