Skip to content

Commit

Permalink
Merge pull request #31 from jordiprats/master
Browse files Browse the repository at this point in the history
improved download resource
  • Loading branch information
jordiprats authored Apr 2, 2020
2 parents 6af2da5 + 28f2ca8 commit 3d7c43f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 0.1.24

* modified **download** resource to use **curl** instead of **wget**
* fix magic hash fact

## 0.1.23

* simplified **eypconf** fact generation
Expand Down
6 changes: 5 additions & 1 deletion lib/facter/eypconf_generic_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /opt/eypconf/id/#{i}'").to_s

if i[0]=='.' then
fact_name=i[1..-1]
if i == ".magic" then
fact_name="magic_hash"
else
fact_name=i[1..-1]
end
else
fact_name=i
end
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/provider/download/download_linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ def check_created_file(file)
end

def run_wget_command(url)

command = ["wget"]
#curl https://yum.puppet.com/puppet5/puppet5-release-el-7.noarch.rpm --create-dirs -o /tmp/prova/cosa/rpm
command = ["curl"]
command.push(url)
command.push("-O ", resource[:creates])
command.push("--create-dirs", "-o ", resource[:creates])

if resource[:cwd]
Dir.chdir resource[:cwd] do
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def retrieve

def sync
output, status = provider.run_wget_command(value)
self.fail("Error executing wget; returned #{status}: '#{output}'") unless status == 0
self.fail("Error executing curl; returned #{status}: '#{output}'") unless status == 0
end
end

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eyp-eyplib",
"version": "0.1.23",
"version": "0.1.24",
"author": "eyp",
"summary": "Utility functions for puppet modules",
"license": "Apache-2.0",
Expand Down

0 comments on commit 3d7c43f

Please sign in to comment.