From 6352ec2dc1ad416270319da412b44e5841dc8917 Mon Sep 17 00:00:00 2001 From: Anoop C S Date: Tue, 11 Jun 2024 16:26:57 +0530 Subject: [PATCH] hosts.update: Reconfigure CentOS 8 repositories to vault CentOS Stream 8 reached EOL but our GPFS and GlusterFS environment setup still has some dependencies which are not yet fulfilled by CentOS Stream 9. In case of GlusterFS it lacks few gluster-ansible related rpms whereas GPFS is not yet ready to be compiled against newer kernel versions from CentOS Stream 9. Therefore we stick to CentOS Stream 8 till requirements are met. See https://github.com/samba-in-kubernetes/sit-environment/issues/102 for further developments. Signed-off-by: Anoop C S --- .../roles/sit.glusterfs/tasks/common/centos.yml | 6 ++++++ .../roles/sit.glusterfs/tasks/common/centos8.yml | 10 ++++++++++ .../roles/sit.glusterfs/tasks/common/centos9.yml | 3 +++ .../roles/sit.glusterfs/tasks/common/main.yml | 13 ++++++++----- .../hosts.update/tasks/{redhat.yml => centos.yml} | 0 playbooks/roles/hosts.update/tasks/centos8.yml | 10 ++++++++++ playbooks/roles/hosts.update/tasks/centos9.yml | 3 +++ 7 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 playbooks/ansible/roles/sit.glusterfs/tasks/common/centos.yml create mode 100644 playbooks/ansible/roles/sit.glusterfs/tasks/common/centos8.yml create mode 100644 playbooks/ansible/roles/sit.glusterfs/tasks/common/centos9.yml rename playbooks/roles/hosts.update/tasks/{redhat.yml => centos.yml} (100%) create mode 100644 playbooks/roles/hosts.update/tasks/centos8.yml create mode 100644 playbooks/roles/hosts.update/tasks/centos9.yml diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos.yml new file mode 100644 index 00000000..40f097ed --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos.yml @@ -0,0 +1,6 @@ +--- +# required for dependencies +- name: Enable GlusterFS repo + yum: + name: centos-release-gluster + state: latest diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos8.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos8.yml new file mode 100644 index 00000000..2004493c --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos8.yml @@ -0,0 +1,10 @@ +--- +- name: Process common OS tasks + include_tasks: centos.yml + +# https://github.com/samba-in-kubernetes/sit-environment/issues/102 +- name: Modify repositories to point at CentOS vault + shell: >- + find /etc/yum.repos.d/ -name '*.repo' -exec sed -i \ + -e 's|^mirrorlist=|#mirrorlist=|g' \ + -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' {} \; diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos9.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos9.yml new file mode 100644 index 00000000..64498162 --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/common/centos9.yml @@ -0,0 +1,3 @@ +--- +- name: Process common OS tasks + include_tasks: centos.yml diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/common/main.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/common/main.yml index 33987359..996969b6 100644 --- a/playbooks/ansible/roles/sit.glusterfs/tasks/common/main.yml +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/common/main.yml @@ -12,8 +12,11 @@ - name: Enable GlusterFS nightly rpms repository command: yum-config-manager --add-repo http://artifacts.ci.centos.org/gluster/nightly/master.repo -# required for dependencies -- name: Enable GlusterFS repo - yum: - name: centos-release-gluster - state: latest +- name: Process OS specific tasks + include_tasks: "{{ include_file }}" + vars: + prefix: "{{ role_path }}/tasks/common/" + with_first_found: + - files: "{{ [prefix] | product(config.os[site.os].includes) | map('join') | list }}" + loop_control: + loop_var: include_file diff --git a/playbooks/roles/hosts.update/tasks/redhat.yml b/playbooks/roles/hosts.update/tasks/centos.yml similarity index 100% rename from playbooks/roles/hosts.update/tasks/redhat.yml rename to playbooks/roles/hosts.update/tasks/centos.yml diff --git a/playbooks/roles/hosts.update/tasks/centos8.yml b/playbooks/roles/hosts.update/tasks/centos8.yml new file mode 100644 index 00000000..358c5333 --- /dev/null +++ b/playbooks/roles/hosts.update/tasks/centos8.yml @@ -0,0 +1,10 @@ +--- +# https://github.com/samba-in-kubernetes/sit-environment/issues/102 +- name: Modify repositories to point at CentOS vault + shell: >- + find /etc/yum.repos.d/ -name '*.repo' -exec sed -i \ + -e 's|^mirrorlist=|#mirrorlist=|g' \ + -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://vault.centos.org|g' {} \; + +- name: Process common OS tasks + include_tasks: centos.yml diff --git a/playbooks/roles/hosts.update/tasks/centos9.yml b/playbooks/roles/hosts.update/tasks/centos9.yml new file mode 100644 index 00000000..64498162 --- /dev/null +++ b/playbooks/roles/hosts.update/tasks/centos9.yml @@ -0,0 +1,3 @@ +--- +- name: Process common OS tasks + include_tasks: centos.yml