Skip to content

Commit

Permalink
Docker: Fix Use Of mirrorlist.centos.org in dockerfiles and Unix play…
Browse files Browse the repository at this point in the history
…books. (#3643)

* docker: Update Centos 7 Image File To Use Vault Rather Than Mirror list.

* Vagrant: Update Centos7 Vagrantfiile to replace mirrorlist

* UnixPB: Update Centos7 SCL Repositories To Not Use Vault & Not Mirrrorlist.
  • Loading branch information
steelhead31 authored Jul 1, 2024
1 parent 5fe6063 commit 92fe27b
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ansible/docker/Dockerfile.CentOS7
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ FROM centos:7
ARG git_sha
ARG user=jenkins

RUN yum -y update; yum -y install epel-release
RUN yum -y install ansible sudo; yum clean all
RUN sed -i -e 's!mirrorlist!#mirrorlist!g' /etc/yum.repos.d/CentOS-Base.repo; \
sed -i -e 's!#baseurl=http://mirror.centos.org/centos/\$releasever!baseurl=https://vault.centos.org/7.9.2009/!g' /etc/yum.repos.d/CentOS-Base.repo; \
yum -y update; yum clean all; \
yum -y install epel-release; \
yum -y install ansible sudo; yum clean all

COPY . /ansible

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,45 @@
- ansible_architecture == "x86_64" and ansible_distribution_major_version == "6"
tags: build_tools

- name: Change the baseurl for CentOS SCL (CentOS7)
lineinfile:
path: /etc/yum.repos.d/CentOS-SCLo-scl.repo
regexp: '^# baseurl=http://mirror.centos.org/centos/7/sclo/\$basearch/sclo/'
line: 'baseurl=https://vault.centos.org/7.9.2009/sclo/$basearch/sclo/'
state: present
when:
- ansible_architecture == "x86_64" and ansible_distribution_major_version == "7"
tags: build_tools

- name: Change the baseurl for CentOS SCL RH (CentOS7)
lineinfile:
path: /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
regexp: '^#baseurl=http://mirror.centos.org/centos/7/sclo/\$basearch/rh/'
line: 'baseurl=https://vault.centos.org/7.9.2009/sclo/$basearch/rh/'
state: present
when:
- ansible_architecture == "x86_64" and ansible_distribution_major_version == "7"
tags: build_tools

# - name: Remove the mirrorlist URL for Centos 7 SCL Repositories
# shell: |
# sed -i -e 's!^mirrorlist!#mirrorlist!g' /etc/yum.repos.d/CentOS-SCLo-scl*.repo
# when:
# - ansible_architecture == "x86_64" and ansible_distribution_major_version == "7"
# tags: build_tools

- name: Remove the mirrorlist URL for Centos 7 SCL Repositories
lineinfile:
path: "{{ item }}"
regexp: '^mirrorlist'
line: '#mirrorlist'
state: present
with_fileglob:
- /etc/yum.repos.d/CentOS-SCLo-scl*.repo
when:
- ansible_architecture == "x86_64" and ansible_distribution_major_version == "7"
tags: build_tools

- name: Install additional build tools for CentOS on x86
package: "name={{ item }} state=latest"
with_items: "{{ Additional_Build_Tools_CentOS_x86 }}"
Expand Down
4 changes: 4 additions & 0 deletions ansible/vagrant/Vagrantfile.CentOS7
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
# vi: set ft=ruby :

$script = <<SCRIPT
sudo sed -i -e 's!mirrorlist!#mirrorlist!g' /etc/yum.repos.d/CentOS-Base.repo
sudo sed -i -e 's!#baseurl=http://mirror.centos.org/centos/\$releasever!baseurl=https://vault.centos.org/7.9.2009/!g' /etc/yum.repos.d/CentOS-Base.repo
sudo yum -y update
sudo yum -y install epel-release
sudo yum install -y libselinux-python
sudo yum install -y ansible
sudo yum clean all
sudo mkdir /ansible
sudo cp /etc/ansible/ansible.cfg /ansible
sudo touch /ansible/hosts
Expand Down

0 comments on commit 92fe27b

Please sign in to comment.