Browse Source

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
changes/39/684439/9
Ian Wienand 2 years ago
parent
commit
3bc89edd32
14 changed files with 86 additions and 10 deletions
  1. +30
    -2
      contrib/setup-gate-mirrors.sh
  2. +1
    -1
      diskimage_builder/elements/centos-minimal/README.rst
  3. +0
    -0
      diskimage_builder/elements/centos-minimal/yum.repos.d/7/yum.repo
  4. +5
    -0
      diskimage_builder/elements/centos-minimal/yum.repos.d/8/appstream.repo
  5. +5
    -0
      diskimage_builder/elements/centos-minimal/yum.repos.d/8/base.repo
  6. +1
    -1
      diskimage_builder/elements/openstack-ci-mirrors/environment.d/11-dib-distribution-mirror.bash
  7. +9
    -1
      diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot
  8. +22
    -5
      roles/dib-setup-gate-mirrors/tasks/main.yaml
  9. +0
    -0
      roles/dib-setup-gate-mirrors/templates/centos-minimal/7/base.repo.j2
  10. +0
    -0
      roles/dib-setup-gate-mirrors/templates/centos-minimal/7/extras.repo.j2
  11. +0
    -0
      roles/dib-setup-gate-mirrors/templates/centos-minimal/7/updates.repo.j2
  12. +4
    -0
      roles/dib-setup-gate-mirrors/templates/centos-minimal/8/appstream.repo.j2
  13. +4
    -0
      roles/dib-setup-gate-mirrors/templates/centos-minimal/8/base.repo.j2
  14. +5
    -0
      roles/dib-setup-gate-mirrors/templates/centos-minimal/8/extras.repo.j2

+ 30
- 2
contrib/setup-gate-mirrors.sh View File

@ -49,8 +49,8 @@ deltarpm=False
deltarpm_percentage=0
EOF
# Centos Minimal
CENTOS_MIN_DIR=$BASE_DIR/centos-minimal/yum.repos.d
# Centos 7 Minimal
CENTOS_MIN_DIR=$BASE_DIR/centos-minimal/yum.repos.d/7
mkdir -p $CENTOS_MIN_DIR
cat <<EOF > $CENTOS_MIN_DIR/dib-mirror-base.repo
@ -76,4 +76,32 @@ baseurl=$NODEPOOL_CENTOS_MIRROR/\$releasever/extras/\$basearch/
gpgcheck=0
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)

+ 1
- 1
diskimage_builder/elements/centos-minimal/README.rst View File

@ -1,7 +1,7 @@
==============
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
Ubuntu and Debian. Nothing additional is needed on Fedora or CentOS.


diskimage_builder/elements/centos-minimal/yum.repos.d/yum.repo → diskimage_builder/elements/centos-minimal/yum.repos.d/7/yum.repo View File


+ 5
- 0
diskimage_builder/elements/centos-minimal/yum.repos.d/8/appstream.repo 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

+ 5
- 0
diskimage_builder/elements/centos-minimal/yum.repos.d/8/base.repo 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

+ 1
- 1
diskimage_builder/elements/openstack-ci-mirrors/environment.d/11-dib-distribution-mirror.bash 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
fi
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


+ 9
- 1
diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot View File

@ -95,7 +95,15 @@ function _install_repos {
# routines. In the gate, environment.d files for the funtional
# tests will set DIB_YUM_MINIMAL_BOOTSTRAP_REPOS -- this contains
# 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
# ${TMPDIR}/yum-$USER-random. Since we don't need this once the


+ 22
- 5
roles/dib-setup-gate-mirrors/tasks/main.yaml View File

@ -5,23 +5,40 @@
- debug: msg="zuul site mirror {{ zuul_site_mirror_fqdn }}"
- debug: msg="mirror_fqdn {{ mirror_fqdn }}"
- name: Create centos-minimal directory
- name: Create centos-minimal 7 directory
file:
path: "{{ dib_gate_mirror_repos }}/centos-minimal/yum.repos.d"
path: "{{ dib_gate_mirror_repos }}/centos-minimal/7/yum.repos.d"
state: directory
mode: 0775
recurse: yes
- name: Install centos-minimal repo files
- name: Install centos-minimal 7 repo files
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
src: "centos-minimal/{{ item }}.j2"
src: "centos-minimal/7/{{ item }}.j2"
with_items:
- base.repo
- updates.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
file:
path: "{{ dib_gate_mirror_repos }}/fedora-minimal/{{ item }}/yum.repos.d"


roles/dib-setup-gate-mirrors/templates/centos-minimal/base.repo.j2 → roles/dib-setup-gate-mirrors/templates/centos-minimal/7/base.repo.j2 View File


roles/dib-setup-gate-mirrors/templates/centos-minimal/extras.repo.j2 → roles/dib-setup-gate-mirrors/templates/centos-minimal/7/extras.repo.j2 View File


roles/dib-setup-gate-mirrors/templates/centos-minimal/updates.repo.j2 → roles/dib-setup-gate-mirrors/templates/centos-minimal/7/updates.repo.j2 View File


+ 4
- 0
roles/dib-setup-gate-mirrors/templates/centos-minimal/8/appstream.repo.j2 View File

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

+ 4
- 0
roles/dib-setup-gate-mirrors/templates/centos-minimal/8/base.repo.j2 View File

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

+ 5
- 0
roles/dib-setup-gate-mirrors/templates/centos-minimal/8/extras.repo.j2 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

Loading…
Cancel
Save