Skip to content

Commit

Permalink
Add download website property (#1268)
Browse files Browse the repository at this point in the history
* Add download website property
  • Loading branch information
yanjunding authored Feb 21, 2024
1 parent de1619e commit 4db7125
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- Add site_url property to docker_installation_package resource

## 11.3.1 - *2024-02-15*

## 11.3.0 - *2023-10-12*
Expand Down
9 changes: 5 additions & 4 deletions resources/installation_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
property :package_version, String, desired_state: false
property :version, String, desired_state: false
property :package_options, String, desired_state: false
property :site_url, String, default: 'download.docker.com'

def el7?
return true if platform_family?('rhel') && node['platform_version'].to_i == 7
Expand Down Expand Up @@ -116,8 +117,8 @@ def version_string(v)
end

yum_repository 'Docker' do
baseurl "https://download.docker.com/linux/#{platform}/#{node['platform_version'].to_i}/#{arch}/#{new_resource.repo_channel}"
gpgkey "https://download.docker.com/linux/#{platform}/gpg"
baseurl "https://#{new_resource.site_url}/linux/#{platform}/#{node['platform_version'].to_i}/#{arch}/#{new_resource.repo_channel}"
gpgkey "https://#{new_resource.site_url}/linux/#{platform}/gpg"
description "Docker #{new_resource.repo_channel.capitalize} repository"
gpgcheck true
enabled true
Expand All @@ -141,9 +142,9 @@ def version_string(v)

apt_repository 'Docker' do
components Array(new_resource.repo_channel)
uri "https://download.docker.com/linux/#{node['platform']}"
uri "https://#{new_resource.site_url}/linux/#{node['platform']}"
arch deb_arch
key "https://download.docker.com/linux/#{node['platform']}/gpg"
key "https://#{new_resource.site_url}/linux/#{node['platform']}/gpg"
action :add
end
else
Expand Down

0 comments on commit 4db7125

Please sign in to comment.