base-jobs/playbooks/base-test/pre.yaml

66 lines
2.4 KiB
YAML

- hosts: localhost
name: Create job header and inventory
roles:
- role: emit-job-header
zuul_log_path_shard_build: true
- log-inventory
# NOTE(ianw) 2022-02-09 : centos8 had a hard shutdown at upstream EOL
# that some were not prepared for. We can't remove the node-type
# because that gives a Zuul error, preventing projects merging changes
# to update their node types (see
# 2c05c44c32db895d2a793265fb86b6bf662c32d0). We've removed all the
# CentOS 8 builds in nodepool and the centos-8 node label is pointing
# at centos-8-stream. But to get people moving off this, we fail jobs
# explicitly using the default nodeset with a name of "centos-8" that
# points to a image of type "centos-8-stream".
#
# This way people can set their jobs non-voting as they merge changes
# to explicitly move away from centos-8 node type. We obviously hope
# to remove this hack ASAP.
- hosts: all
name: Hard fail CentOS 8 nodes
tasks:
- name: Fail CentOS 8 nodes
fail:
msg: "The centos-8 node type is no longer supported. You need to switch this job to use a centos-8-stream node type."
when:
- item == 'centos-8'
- hostvars[item]['nodepool']['label'] == 'centos-8-stream'
loop: "{{ query('inventory_hostnames', 'all,!localhost') }}"
- hosts: all
name: Setup Zuul environment
pre_tasks:
# NOTE(pabelanger): Until we hit the validate-host role, we have a minimal
# set of ansible variables collected by zuul-executor. This doesn't include
# network variables (ansible_default_ipv4 / ansible_default_ipv6) so gather
# these variables as they are important to the configure-unbound role.
- name: Gather network facts
setup:
gather_subset: 'network'
roles:
- add-build-sshkey
- start-zuul-console
- ensure-output-dirs
- hosts: all
name: Configure unbound
roles:
# NOTE(pabelanger): We run this role in its own play to ensure unbound is
# restarted before proceeding with any other role. This is because we use
# notify / handler to restart the unbound service. With ansible notify
# actions are triggered at the end of each block of tasks in a play.
- configure-unbound
- hosts: all
name: Prepare workspace and configure mirrors
roles:
- validate-host
- prepare-workspace-git
- mirror-info
- role: configure-mirrors
set_apt_mirrors_trusted: True
mirror_use_ssl: True