From 417bc3f00d6261f60af02d366206b26fc9addca8 Mon Sep 17 00:00:00 2001 From: Peter Doherty Date: Thu, 29 Feb 2024 10:45:05 -0500 Subject: [PATCH] Update yum config for CentOS Stream 9 The Powertools repo doesn't exist for CentOS Stream 9. The equivalent packages are in the CRB repo. --- CHANGELOG.md | 2 ++ resources/install.rb | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf5fe17..2df2a26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +- CentOS Stream 9 uses 'crb' instead of the 'powertools' repo. + ## 2.5.5 - *2023-10-26* ## 2.5.4 - *2023-09-29* diff --git a/resources/install.rb b/resources/install.rb index d3c8daf..e5bae23 100644 --- a/resources/install.rb +++ b/resources/install.rb @@ -10,7 +10,13 @@ src_path = "#{Chef::Config['file_cache_path']}/ruby-build" if platform_family?('rhel') - if node['platform_version'].to_i >= 8 + if node['platform_version'].to_i == 9 + package 'yum-utils' + + execute 'yum-config-manager --enable crb' do + not_if 'yum-config-manager --dump crb | grep -q "enabled = 1"' + end + elsif node['platform_version'].to_i == 8 package 'yum-utils' execute 'yum-config-manager --enable powertools' do