From cf56898ba513a4d14b2a577bd2a5cb13b615034a Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Thu, 2 Apr 2020 13:55:10 +0200 Subject: [PATCH 1/2] curl en lloc de wget --- CHANGELOG.md | 4 ++++ lib/puppet/provider/download/download_linux.rb | 6 +++--- lib/puppet/type/download.rb | 2 +- metadata.json | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f42bf8a..ed2daf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 0.1.24 + +* modified **download** resource to use **curl** instead of **wget** + ## 0.1.23 * simplified **eypconf** fact generation diff --git a/lib/puppet/provider/download/download_linux.rb b/lib/puppet/provider/download/download_linux.rb index 3c23a1e..13e1d69 100644 --- a/lib/puppet/provider/download/download_linux.rb +++ b/lib/puppet/provider/download/download_linux.rb @@ -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 diff --git a/lib/puppet/type/download.rb b/lib/puppet/type/download.rb index 711797f..a4c7976 100644 --- a/lib/puppet/type/download.rb +++ b/lib/puppet/type/download.rb @@ -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 diff --git a/metadata.json b/metadata.json index fbba535..c556fa7 100644 --- a/metadata.json +++ b/metadata.json @@ -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", From 28f2ca805b293cd7173ad76e314075969effcc62 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Thu, 2 Apr 2020 14:00:45 +0200 Subject: [PATCH 2/2] fix magic --- CHANGELOG.md | 1 + lib/facter/eypconf_generic_id.rb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed2daf7..b904790 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.1.24 * modified **download** resource to use **curl** instead of **wget** +* fix magic hash fact ## 0.1.23 diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index fbae07d..d44c20b 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -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