yum-minimal : update mirrors for Centos 8

The repo format has slightly changed for CentOS 8 (s/os/baseos/).

Make the chroot builder look for a more specific repos.d directory
first named for the distro variable, then fall back to to top-level
dir (this avoids having to constantly change fedora).

Update the gate mirror setup and roles for new Centos 8 paths too.

Change-Id: I5b7f0c3624cac1d7aa7ed8bf6286b85d808b9c9a
This commit is contained in:
Ian Wienand 2019-09-25 00:53:39 +00:00
parent 456b6cf394
commit 3bc89edd32
14 changed files with 86 additions and 10 deletions

View File

@ -49,8 +49,8 @@ deltarpm=False
deltarpm_percentage=0 deltarpm_percentage=0
EOF EOF
# Centos Minimal # Centos 7 Minimal
CENTOS_MIN_DIR=$BASE_DIR/centos-minimal/yum.repos.d CENTOS_MIN_DIR=$BASE_DIR/centos-minimal/yum.repos.d/7
mkdir -p $CENTOS_MIN_DIR mkdir -p $CENTOS_MIN_DIR
cat <<EOF > $CENTOS_MIN_DIR/dib-mirror-base.repo cat <<EOF > $CENTOS_MIN_DIR/dib-mirror-base.repo
@ -76,4 +76,32 @@ baseurl=$NODEPOOL_CENTOS_MIRROR/\$releasever/extras/\$basearch/
gpgcheck=0 gpgcheck=0
EOF EOF
# Centos 8 Minimal
CENTOS_MIN_DIR=$BASE_DIR/centos-minimal/yum.repos.d/8
mkdir -p $CENTOS_MIN_DIR
cat <<EOF > $CENTOS_MIN_DIR/dib-mirror-base.repo
[base]
name=CentOS-\$releasever - Base
baseurl=$NODEPOOL_CENTOS_MIRROR/\$releasever/BaseOS/\$basearch/os/
gpgcheck=0
EOF
cat <<EOF > $CENTOS_MIN_DIR/dib-mirror-appstream.repo
[base]
name=CentOS-\$releasever - AppStream
baseurl=$NODEPOOL_CENTOS_MIRROR/\$releasever/AppStream/\$basearch/os/
gpgcheck=0
EOF
cat <<EOF > $CENTOS_MIN_DIR/dib-mirror-extras.repo
#additional packages that may be useful
[extras]
name=CentOS-\$releasever - Extras
baseurl=$NODEPOOL_CENTOS_MIRROR/\$releasever/extras/\$basearch/os/
gpgcheck=0
EOF
## apt sources (todo) ## apt sources (todo)

View File

@ -1,7 +1,7 @@
============== ==============
centos-minimal centos-minimal
============== ==============
Create a minimal image based on CentOS 7. Create a minimal image based on CentOS
Use of this element will require 'yum' and 'yum-utils' to be installed on Use of this element will require 'yum' and 'yum-utils' to be installed on
Ubuntu and Debian. Nothing additional is needed on Fedora or CentOS. Ubuntu and Debian. Nothing additional is needed on Fedora or CentOS.

View File

@ -0,0 +1,5 @@
[centos-appstream]
name=CentOS-$releasever - AppStream
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=appstream
gpgcheck=0

View File

@ -0,0 +1,5 @@
[centos-base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=baseos
gpgcheck=0

View File

@ -53,7 +53,7 @@ if [[ -d ${DIB_OS_CI_YUM_REPOS:-/not/a/path/} ]]; then
export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/fedora-minimal/default/yum.repos.d export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/fedora-minimal/default/yum.repos.d
fi fi
elif [[ "${DISTRO_NAME}" == "centos" ]]; then elif [[ "${DISTRO_NAME}" == "centos" ]]; then
export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/centos-minimal/yum.repos.d export DIB_YUM_MINIMAL_BOOTSTRAP_REPOS=${DIB_OS_CI_YUM_REPOS}/centos-minimal/${DIB_RELEASE}/yum.repos.d
fi fi
fi fi

View File

@ -95,7 +95,15 @@ function _install_repos {
# routines. In the gate, environment.d files for the funtional # routines. In the gate, environment.d files for the funtional
# tests will set DIB_YUM_MINIMAL_BOOTSTRAP_REPOS -- this contains # tests will set DIB_YUM_MINIMAL_BOOTSTRAP_REPOS -- this contains
# mirrors correct for the region setup by contrib/setup-gate-mirrors.sh # mirrors correct for the region setup by contrib/setup-gate-mirrors.sh
local repo=${DIB_YUM_MINIMAL_BOOTSTRAP_REPOS:-${TMP_HOOKS_PATH}/yum.repos.d} local repo=${DIB_YUM_MINIMAL_BOOTSTRAP_REPOS:-}
if [[ -z ${repo} ]]; then
# take in preference more specific subdirs
if [[ -d ${TMP_HOOKS_PATH}/yum.repos.d/${DIB_RELEASE} ]]; then
repo=${TMP_HOOKS_PATH}/yum.repos.d/${DIB_RELEASE}
else
repo=${TMP_HOOKS_PATH}/yum.repos.d
fi
fi
# yumdownloader puts repo xml files and such into a directory # yumdownloader puts repo xml files and such into a directory
# ${TMPDIR}/yum-$USER-random. Since we don't need this once the # ${TMPDIR}/yum-$USER-random. Since we don't need this once the

View File

@ -5,23 +5,40 @@
- debug: msg="zuul site mirror {{ zuul_site_mirror_fqdn }}" - debug: msg="zuul site mirror {{ zuul_site_mirror_fqdn }}"
- debug: msg="mirror_fqdn {{ mirror_fqdn }}" - debug: msg="mirror_fqdn {{ mirror_fqdn }}"
- name: Create centos-minimal directory - name: Create centos-minimal 7 directory
file: file:
path: "{{ dib_gate_mirror_repos }}/centos-minimal/yum.repos.d" path: "{{ dib_gate_mirror_repos }}/centos-minimal/7/yum.repos.d"
state: directory state: directory
mode: 0775 mode: 0775
recurse: yes recurse: yes
- name: Install centos-minimal repo files - name: Install centos-minimal 7 repo files
template: template:
dest: "{{ dib_gate_mirror_repos }}/centos-minimal/yum.repos.d/dib-mirror-{{ item }}" dest: "{{ dib_gate_mirror_repos }}/centos-minimal/7/yum.repos.d/dib-mirror-{{ item }}"
mode: 0644 mode: 0644
src: "centos-minimal/{{ item }}.j2" src: "centos-minimal/7/{{ item }}.j2"
with_items: with_items:
- base.repo - base.repo
- updates.repo - updates.repo
- extras.repo - extras.repo
- name: Create centos-minimal 8 directory
file:
path: "{{ dib_gate_mirror_repos }}/centos-minimal/8/yum.repos.d"
state: directory
mode: 0775
recurse: yes
- name: Install centos-minimal 8 repo files
template:
dest: "{{ dib_gate_mirror_repos }}/centos-minimal/8/yum.repos.d/dib-mirror-{{ item }}"
mode: 0644
src: "centos-minimal/8/{{ item }}.j2"
with_items:
- base.repo
- appstream.repo
- extras.repo
- name: Create fedora-minimal directories - name: Create fedora-minimal directories
file: file:
path: "{{ dib_gate_mirror_repos }}/fedora-minimal/{{ item }}/yum.repos.d" path: "{{ dib_gate_mirror_repos }}/fedora-minimal/{{ item }}/yum.repos.d"

View File

@ -0,0 +1,4 @@
[AppStream]
name=CentOS-$releasever - AppStream
baseurl=http://{{ mirror_fqdn }}/centos/$releasever/AppStream/$basearch/os/
gpgcheck=0

View File

@ -0,0 +1,4 @@
[base]
name=CentOS-$releasever - Base
baseurl=http://{{ mirror_fqdn }}/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=0

View File

@ -0,0 +1,5 @@
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://{{ mirror_fqdn }}/centos/$releasever/extras/$basearch/os/
gpgcheck=0