Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker: Fix Use Of mirrorlist.centos.org in dockerfiles and Unix playbooks. #3643

Merged
merged 3 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading