From c843c3f9eef216ab7a90212ab173d1a0a4d97da1 Mon Sep 17 00:00:00 2001 From: Vasily Kleschov Date: Tue, 30 Jul 2024 16:15:31 +0200 Subject: [PATCH] Fix centos 7 x32 provision issues Resolves: https://cloudlinux.atlassian.net/browse/AL-5508 --- Dockerfile.celery | 4 ++-- alts/shared/models.py | 2 +- resources/roles/preparation/tasks/rhel.yml | 25 +++++++++++++++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/Dockerfile.celery b/Dockerfile.celery index 81eaa91..12581bf 100644 --- a/Dockerfile.celery +++ b/Dockerfile.celery @@ -18,7 +18,7 @@ EOT RUN <> /root/.terraformrc + echo 'plugin_cache_dir = "$HOME/.terraform.d/plugin-cache"' >> /root/.terraformrc echo "plugin_cache_may_break_dependency_lock_file = true" >> /root/.terraformrc EOT diff --git a/alts/shared/models.py b/alts/shared/models.py index c2d9102..056edcc 100644 --- a/alts/shared/models.py +++ b/alts/shared/models.py @@ -305,7 +305,7 @@ def __init__(self, **data): '6': 'http://dl.fedoraproject.org/pub/archive/epel/6/x86_64/' 'epel-release-6-8.noarch.rpm', '7': 'https://dl.fedoraproject.org/pub/archive/epel/7/x86_64/' - 'Packages/e/epel-release-7-12.noarch.rpm', + 'Packages/e/epel-release-7-14.noarch.rpm', } centos_baseurl: str = 'http://mirror.centos.org/centos' git_reference_directory: Optional[str] = None diff --git a/resources/roles/preparation/tasks/rhel.yml b/resources/roles/preparation/tasks/rhel.yml index 121a778..6e2697d 100644 --- a/resources/roles/preparation/tasks/rhel.yml +++ b/resources/roles/preparation/tasks/rhel.yml @@ -4,15 +4,23 @@ set_fact: centos_7_x32: false bats_package: bats + final_centos_repo_baseurl: "{{ centos_repo_baseurl }}" - name: Set fact about CentOS 7 x32 arch set_fact: centos_7_x32: true bats_package: "http://ftp.icm.edu.pl/pub/Linux/dist/epel/7/x86_64/Packages/b/bats-0.4.0-1.20141016git3b33a5a.el7.noarch.rpm" + final_centos_repo_baseurl: "{{ centos_repo_baseurl }}/altarch" + centos_distro_version: "7" when: > ansible_facts.distribution_major_version == '7' and ansible_facts.userspace_architecture in ('i386', 'i486', 'i586', 'i686') +- name: Set fact about distro version for CentOS 7 x86_64 + set_fact: + centos_distro_version: "7.9.2009" + when: "ansible_facts.distribution_major_version == '7' and ansible_facts.userspace_architecture == 'x86_64'" + - name: Re-define procps package name set_fact: procps_pkg: "procps-ng" @@ -40,7 +48,7 @@ - name: Add os and updates repositories for version 6 yum_repository: name: "centos-6-{{ item }}" - baseurl: "{{ centos_repo_baseurl }}/6.10/{{ item }}/$basearch/" + baseurl: "{{ final_centos_repo_baseurl }}/6.10/{{ item }}/$basearch/" description: "CentOS 6 {{ item }} repository" enabled: yes gpgcheck: yes @@ -52,6 +60,21 @@ ansible_distribution_file_variety in ('RedHat', 'CentOS') and ansible_facts.distribution_major_version == '6' +- name: Add os and updates repositories for version 7 + yum_repository: + name: "centos-7-{{ item }}" + baseurl: "{{ final_centos_repo_baseurl }}/{{ centos_distro_version }}/{{ item }}/$basearch/" + description: "CentOS 7 {{ item }} repository" + enabled: yes + gpgcheck: yes + gpgkey: https://vault.centos.org/7.9.2009/os/x86_64/RPM-GPG-KEY-CentOS-7 + with_items: + - "os" + - "updates" + when: > + ansible_distribution_file_variety in ('RedHat', 'CentOS') and + ansible_facts.distribution_major_version == '7' + - name: Add YUM proxy ini_file: path: /etc/yum.conf