-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhelpers.rb
More file actions
32 lines (26 loc) · 1.06 KB
/
helpers.rb
File metadata and controls
32 lines (26 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true
module YumAlmaChef
module Cookbook
module Helpers
def alma_gpg_key
"https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux-#{node['platform_version'].to_i}"
end
def alma_repo_baseurl(repo_slug, debug = false)
repo_slug = debug ? "#{repo_slug}/debug" : repo_slug
"https://repo.almalinux.org/almalinux/#{node['platform_version'].to_i}/#{repo_slug}/$basearch/os/"
end
def alma_repo_mirrorlist(repo_slug, debug = false)
repo_slug = debug ? "#{repo_slug}-debuginfo" : repo_slug
"https://mirrors.almalinux.org/mirrorlist/#{node['platform_version'].to_i}/#{repo_slug.downcase}/"
end
def alma_repo_description(repo_slug, debug = false)
repo_slug = debug ? "#{repo_slug}-debuginfo" : repo_slug
"AlmaLinux #{node['platform_version'].to_i} - #{repo_slug}"
end
def alma_powertools_repo_name
node['platform_version'].to_i == 8 ? 'PowerTools' : 'CRB'
end
end
end
end
Chef::Resource.include ::YumAlmaChef::Cookbook::Helpers