From f5c166c944761cfd56062c0ea2ce98ea326d912f Mon Sep 17 00:00:00 2001 From: Tom Parker Date: Thu, 20 May 2021 18:49:05 -0400 Subject: [PATCH] Added support for AlmaLinux 8 --- data/os/RedHat/AlmaLinux.yaml | 125 ++++++++++++++++++++++++++++++++++ metadata.json | 6 ++ spec/classes/init_spec.rb | 46 ++++++++++++- 3 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 data/os/RedHat/AlmaLinux.yaml diff --git a/data/os/RedHat/AlmaLinux.yaml b/data/os/RedHat/AlmaLinux.yaml new file mode 100644 index 00000000..123cd277 --- /dev/null +++ b/data/os/RedHat/AlmaLinux.yaml @@ -0,0 +1,125 @@ +--- +yum::os_default_repos: + - 'baseos' + - 'appstream' + - 'powertools' + - 'extras' + - 'baseos-source' + - 'appstream-source' + - 'powertools-source' + - 'extras-source' + - 'baseos-debuginfo' + - 'appstream-debuginfo' + - 'powertools-debuginfo' + - 'extras-debuginfo' + +yum::repos: + baseos: + enabled: true + descr: 'AlmaLinux-$releasever - BaseOS' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/baseos' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/BaseOS/$basearch/os/ + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + target: '/etc/yum.repos.d/almalinux.repo' + fastestmirror: true + + appstream: + enabled: true + descr: 'AlmaLinux $releasever - AppStream' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/appstream' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/AppStream/$basearch/os/ + gpgcheck: true + gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux" + target: '/etc/yum.repos.d/almalinux.repo' + fastestmirror: true + + powertools: + descr: 'AlmaLinux $releasever - PowerTools' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/powertools' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/PowerTools/$basearch/os/ + enabled: true + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true + + extras: + name: 'AlmaLinux $releasever - Extras' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/extras' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/extras/$basearch/os/ + enabled: true + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true + + baseos-source: + name: 'AlmaLinux $releasever - BaseOS Source' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-source' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/BaseOS/Source/ + enabled: false + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true + + appstream-source: + name: 'AlmaLinux $releasever - AppStream Source' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-source' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/AppStream/Source/ + enabled: false + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true + + powertools-source: + name: 'AlmaLinux $releasever - PowerTools Source' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/powertools-source' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/PowerTools/Source/ + enabled: false + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true + + extras-source: + name: 'AlmaLinux $releasever - Extras Source' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/extras-source' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/extras/Source/ + enabled: false + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true + + baseos-debuginfo: + name: 'AlmaLinux $releasever - BaseOS debuginfo' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/baseos-debuginfo' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/BaseOS/debug/$basearch/ + enabled: false + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true + + appstream-debuginfo: + name: 'AlmaLinux $releasever - AppStream debuginfo' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/appstream-debuginfo' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/AppStream/debug/$basearch/ + enabled: false + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true + + powertools-debuginfo: + name: 'AlmaLinux $releasever - PowerTools debuginfo' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/powertools-debuginfo' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/PowerTools/debug/$basearch/ + enabled: false + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true + + extras-debuginfo: + name: 'AlmaLinux $releasever - Extras debuginfo' + mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/$releasever/extras-debuginfo' + # baseurl: https://repo.almalinux.org/almalinux/$releasever/extras/debug/$basearch/ + enabled: false + gpgcheck: true + gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux' + fastestmirror: true diff --git a/metadata.json b/metadata.json index c0bca61e..7e015c3e 100644 --- a/metadata.json +++ b/metadata.json @@ -70,6 +70,12 @@ "operatingsystemrelease": [ "2017" ] + }, + { + "operatingsystem": "AlmaLinux", + "operatingsystemrelease": [ + "8" + ] } ], "requirements": [ diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index bf61704e..8f23b4c9 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -58,7 +58,7 @@ when '8' it { is_expected.to have_yumrepo_resource_count(11) } else - it { is_expected.to have_yumrepo_resource_count(0) } + it { is_expected.to have_yumrepo_resource_count(0) } # rubocop:disable RSpec/RepeatedExample end when 'CentOS' it_behaves_like 'a catalog containing repos', [ @@ -129,7 +129,7 @@ when 'VirtuozzoLinux' case facts[:os]['release']['major'] when '6' - it { is_expected.to have_yumrepo_resource_count(12) } + it { is_expected.to have_yumrepo_resource_count(12) } # rubocop:disable RSpec/RepeatedExample it_behaves_like 'a catalog containing repos', [ 'virtuozzolinux-base', 'virtuozzolinux-updates', @@ -165,6 +165,27 @@ 'virtuozzolinux-vz-factory-debuginfo' ] end + when 'AlmaLinux' + case facts[:os]['release']['major'] + when '8' + it { is_expected.to have_yumrepo_resource_count(12) } # rubocop:disable RSpec/RepeatedExample + it_behaves_like 'a catalog containing repos', [ + 'baseos', + 'appstream', + 'powertools', + 'extras', + 'baseos-source', + 'appstream-source', + 'powertools-source', + 'extras-source', + 'baseos-debuginfo', + 'appstream-debuginfo', + 'powertools-debuginfo', + 'extras-debuginfo', + ] + end + else + it { is_expected.to have_yumrepo_resource_count(0) } # rubocop:disable RSpec/RepeatedExample end context 'and the CentOS base repo is negated' do @@ -228,7 +249,7 @@ when 'VirtuozzoLinux' case facts[:os]['release']['major'] when '6' - it { is_expected.to have_yumrepo_resource_count(12) } + it { is_expected.to have_yumrepo_resource_count(12) } # rubocop:disable RSpec/RepeatedExample it_behaves_like 'a catalog containing repos', [ 'virtuozzolinux-base', 'virtuozzolinux-updates', @@ -264,6 +285,25 @@ 'virtuozzolinux-vz-factory-debuginfo' ] end + when 'AlmaLinux' + case facts[:os]['release']['major'] + when '8' + it { is_expected.to have_yumrepo_resource_count(12) } # rubocop:disable RSpec/RepeatedExample + it_behaves_like 'a catalog containing repos', [ + 'baseos', + 'appstream', + 'powertools', + 'extras', + 'baseos-source', + 'appstream-source', + 'powertools-source', + 'extras-source', + 'baseos-debuginfo', + 'appstream-debuginfo', + 'powertools-debuginfo', + 'extras-debuginfo', + ] + end else it { is_expected.to have_yumrepo_resource_count(0) } end