Files
tripleo-ci/playbooks/tripleo-buildcontainers/pre.yaml
Marios Andreou bc27851617 Use repo-setup role and tripleo-quickstart config for C9 images
Adds a new role tripleo-build-jobs-repos that is used by
container and image build pre playbooks to setup repos with
the repo-setup role for Centos9.

Depends-On 817161 modifies the release files to use the c9 stream
repos and carries workaround until a better fix is merged like [1]
or similar.

[1] https://review.opendev.org/c/opendev/base-jobs/+/820018
Depends-On: https://review.opendev.org/c/openstack/tripleo-quickstart/+/817161

Change-Id: I39fc32cf1249b4f14bdc35a4af7a1f8784c19801
2021-12-03 09:28:16 +02:00

71 lines
2.5 KiB
YAML

---
- hosts: all
name: TripleO Setup Container Registry and repos mirror
tasks:
- name: Disable EPEL repos with dnf if exists
command: dnf config-manager --set-disabled "epel*"
become: true
changed_when: true
failed_when: false
when:
- ansible_pkg_mgr == "dnf"
- name: Disable EPEL repos with yum if exists
command: yum-config-manager --disable "epel*"
become: true
changed_when: true
failed_when: false
when:
- ansible_pkg_mgr == "yum"
- name: Container Build for 8 specific distros
when: ansible_distribution_major_version is version(8, '<=')
block:
- name: Include tripleo-repos
include_role:
name: tripleo-repos
vars:
override_repos: "{{ buildcontainers_override_repos | default('') }}"
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
# TODO: Move this setting to tripleo-repos yum module
- name: Enable supported container tools version
become: true
shell: |
{{ ansible_pkg_mgr }} module disable container-tools:rhel8 -y;
{{ ansible_pkg_mgr }} module enable container-tools:3.0 -y;
{{ ansible_pkg_mgr }} clean metadata
when: ansible_distribution_major_version is version(8, '==')
# workaround for LP #1950916
- name: Check if /etc/yum.repos.d/CentOS-Stream-AppStream.repo exists
stat:
path: /etc/yum.repos.d/CentOS-Stream-AppStream.repo
register: stat_appstream
- name: Exclude libvirt/qemu from AppStream repo
become: true
lineinfile:
dest: /etc/yum.repos.d/CentOS-Stream-AppStream.repo
line: "exclude=libvirt*,python*libvirt*,qemu*"
when:
- stat_appstream.stat.exists
- release is defined and release in ['master', 'wallaby']
- name: Include bindep role
include_role:
name: bindep
vars:
bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/python-tripleoclient'].src_dir }}"
- name: Setup repos using repo-setup role and release file
when: ansible_distribution_major_version is version(9, '>=')
include_role:
name: tripleo-build-jobs-repos
- name: Run build containers pre tasks
include_role:
name: build-containers
tasks_from: pre