From 2f1ff647b7472771c830d24f57a78117c1df3ebc Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 15:48:21 +0200 Subject: [PATCH 01/12] prova id --- lib/facter/eypconf_generic_id.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/facter/eypconf_generic_id.rb diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb new file mode 100644 index 0000000..4b3b767 --- /dev/null +++ b/lib/facter/eypconf_generic_id.rb @@ -0,0 +1,25 @@ +Dir.entries("/etc/eypconf/id").select {|f| !File.directory? f}.each do |i| + + genetic_id = Facter::Util::Resolution.exec('bash |i|').to_s + + unless genetic_id.nil? or genetic_id.empty? + Facter.add('eypconf_|i|') do + setcode do + genetic_id + end + end + + Facter.add('eypconf_|i|_uppercase') do + setcode do + genetic_id.upcase + end + end + + Facter.add('eypconf_|i|_lowercase') do + setcode do + genetic_id.downcase + end + end + end + +end From ebff22208e9ac8f0d46270a2ef4a05432bd95418 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 15:49:08 +0200 Subject: [PATCH 02/12] cat --- lib/facter/eypconf_generic_id.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index 4b3b767..4a08ccc 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -1,6 +1,6 @@ Dir.entries("/etc/eypconf/id").select {|f| !File.directory? f}.each do |i| - genetic_id = Facter::Util::Resolution.exec('bash |i|').to_s + genetic_id = Facter::Util::Resolution.exec('cat |i|').to_s unless genetic_id.nil? or genetic_id.empty? Facter.add('eypconf_|i|') do From bbb9cdd8a4ee10babf07a01375b56a0921b42d3e Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 15:55:18 +0200 Subject: [PATCH 03/12] source fact --- lib/facter/eypconf_generic_id.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index 4a08ccc..ac776e8 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -20,6 +20,12 @@ genetic_id.downcase end end + + Facter.add('eypconf_|i|_source') do + setcode do + i + end + end end end From 2ea6cda83b200ebea3c811f6c98fffdbdf6c3feb Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 16:14:28 +0200 Subject: [PATCH 04/12] retry --- lib/facter/eypconf_generic_id.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index ac776e8..d297fac 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -1,6 +1,6 @@ Dir.entries("/etc/eypconf/id").select {|f| !File.directory? f}.each do |i| - genetic_id = Facter::Util::Resolution.exec('cat |i|').to_s + genetic_id = Facter::Util::Resolution.exec('bash -c \'cat |i|\'').to_s unless genetic_id.nil? or genetic_id.empty? Facter.add('eypconf_|i|') do From 68764cf959bccd3eb856e46b2764b78504b03045 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 16:20:21 +0200 Subject: [PATCH 05/12] return --- lib/facter/eypconf_generic_id.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index d297fac..250bc07 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -1,27 +1,27 @@ Dir.entries("/etc/eypconf/id").select {|f| !File.directory? f}.each do |i| - genetic_id = Facter::Util::Resolution.exec('bash -c \'cat |i|\'').to_s + genetic_id = Facter::Util::Resolution.exec('bash -c \'cat #{i}\'').to_s unless genetic_id.nil? or genetic_id.empty? - Facter.add('eypconf_|i|') do + Facter.add('eypconf_#{i}') do setcode do genetic_id end end - Facter.add('eypconf_|i|_uppercase') do + Facter.add('eypconf_#{i}|_uppercase') do setcode do genetic_id.upcase end end - Facter.add('eypconf_|i|_lowercase') do + Facter.add('eypconf_#{i}_lowercase') do setcode do genetic_id.downcase end end - Facter.add('eypconf_|i|_source') do + Facter.add('eypconf_#{i}_source') do setcode do i end From 961973baa27c2c220b36aa7cc8a5279507887162 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 16:21:59 +0200 Subject: [PATCH 06/12] cometes --- lib/facter/eypconf_generic_id.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index 250bc07..cb23163 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -1,27 +1,27 @@ Dir.entries("/etc/eypconf/id").select {|f| !File.directory? f}.each do |i| - genetic_id = Facter::Util::Resolution.exec('bash -c \'cat #{i}\'').to_s + genetic_id = Facter::Util::Resolution.exec("bash -c 'cat #{i}'").to_s unless genetic_id.nil? or genetic_id.empty? - Facter.add('eypconf_#{i}') do + Facter.add("eypconf_#{i}") do setcode do genetic_id end end - Facter.add('eypconf_#{i}|_uppercase') do + Facter.add("eypconf_#{i}|_uppercase") do setcode do genetic_id.upcase end end - Facter.add('eypconf_#{i}_lowercase') do + Facter.add("eypconf_#{i}_lowercase") do setcode do genetic_id.downcase end end - Facter.add('eypconf_#{i}_source') do + Facter.add("eypconf_#{i}_source") do setcode do i end From 85af1672e2f5ffe7ad644290e13c0ca32af044e2 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 16:25:45 +0200 Subject: [PATCH 07/12] generic id --- lib/facter/eypconf_generic_id.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index cb23163..4cffb8d 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -1,6 +1,6 @@ Dir.entries("/etc/eypconf/id").select {|f| !File.directory? f}.each do |i| - genetic_id = Facter::Util::Resolution.exec("bash -c 'cat #{i}'").to_s + genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /etc/eypconf/id/#{i}'").to_s unless genetic_id.nil? or genetic_id.empty? Facter.add("eypconf_#{i}") do From 1e0487c089e70b0e295728472c63bf37dd232079 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 16:32:35 +0200 Subject: [PATCH 08/12] coses --- lib/facter/eypconf_generic_id.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index 4cffb8d..1c77b71 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -1,27 +1,33 @@ Dir.entries("/etc/eypconf/id").select {|f| !File.directory? f}.each do |i| - genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /etc/eypconf/id/#{i}'").to_s + if i[0]=='.' + fact_name=i[1..-1] + genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /etc/eypconf/id/#{fact_name}'").to_s + else + fact_name=i + genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /etc/eypconf/id/#{fact_name}'").to_s + end unless genetic_id.nil? or genetic_id.empty? - Facter.add("eypconf_#{i}") do + Facter.add("eypconf_#{fact_name}") do setcode do genetic_id end end - Facter.add("eypconf_#{i}|_uppercase") do + Facter.add("eypconf_#{fact_name}|_uppercase") do setcode do genetic_id.upcase end end - Facter.add("eypconf_#{i}_lowercase") do + Facter.add("eypconf_#{fact_name}_lowercase") do setcode do genetic_id.downcase end end - Facter.add("eypconf_#{i}_source") do + Facter.add("eypconf_#{fact_name}_source") do setcode do i end From 19a48ecb543c2d84197364429a8fd3a50769f986 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 16:38:23 +0200 Subject: [PATCH 09/12] simplificacio --- lib/facter/eypconf_generic_id.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index 1c77b71..3b4da30 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -1,11 +1,11 @@ Dir.entries("/etc/eypconf/id").select {|f| !File.directory? f}.each do |i| + genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /etc/eypconf/id/#{i}'").to_s + if i[0]=='.' fact_name=i[1..-1] - genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /etc/eypconf/id/#{fact_name}'").to_s else fact_name=i - genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /etc/eypconf/id/#{fact_name}'").to_s end unless genetic_id.nil? or genetic_id.empty? From 1e0a6bc932a7b9b6ccf1faebfadb56820a8bc837 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 16:41:39 +0200 Subject: [PATCH 10/12] simplified fact generation --- CHANGELOG.md | 4 ++++ lib/facter/eypconf_customer.rb | 25 ------------------------- lib/facter/eypconf_description.rb | 14 -------------- lib/facter/eypconf_env.rb | 26 -------------------------- lib/facter/eypconf_generic_id.rb | 6 +++--- lib/facter/eypconf_location.rb | 14 -------------- lib/facter/eypconf_magic_hash.rb | 13 ------------- lib/facter/eypconf_platformid.rb | 25 ------------------------- lib/facter/eypconf_servergroup.rb | 25 ------------------------- lib/facter/eypconf_sg.rb | 25 ------------------------- lib/facter/eypconf_type.rb | 25 ------------------------- lib/facter/eypconf_userid.rb | 25 ------------------------- metadata.json | 2 +- 13 files changed, 8 insertions(+), 221 deletions(-) delete mode 100644 lib/facter/eypconf_customer.rb delete mode 100644 lib/facter/eypconf_description.rb delete mode 100644 lib/facter/eypconf_env.rb delete mode 100644 lib/facter/eypconf_location.rb delete mode 100644 lib/facter/eypconf_magic_hash.rb delete mode 100644 lib/facter/eypconf_platformid.rb delete mode 100644 lib/facter/eypconf_servergroup.rb delete mode 100644 lib/facter/eypconf_sg.rb delete mode 100644 lib/facter/eypconf_type.rb delete mode 100644 lib/facter/eypconf_userid.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index b023eca..f42bf8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 0.1.23 + +* simplified **eypconf** fact generation + ## 0.1.22 * added **eypconf_location** diff --git a/lib/facter/eypconf_customer.rb b/lib/facter/eypconf_customer.rb deleted file mode 100644 index 6b4a01e..0000000 --- a/lib/facter/eypconf_customer.rb +++ /dev/null @@ -1,25 +0,0 @@ -if File.exists?('/opt/eypconf/id/customer.sh') then - customer = Facter::Util::Resolution.exec('bash /opt/eypconf/id/customer.sh').to_s -else - customer = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/customer ]; then cat /opt/eypconf/id/customer | paste -sd,; fi\'').to_s -end - -unless customer.nil? or customer.empty? - Facter.add('eypconf_customer') do - setcode do - customer - end - end - - Facter.add('eypconf_customer_uppercase') do - setcode do - customer.upcase - end - end - - Facter.add('eypconf_customer_lowercase') do - setcode do - customer.downcase - end - end -end diff --git a/lib/facter/eypconf_description.rb b/lib/facter/eypconf_description.rb deleted file mode 100644 index a2a5fab..0000000 --- a/lib/facter/eypconf_description.rb +++ /dev/null @@ -1,14 +0,0 @@ -if File.exists?('/opt/eypconf/id/description.sh') then - description = Facter::Util::Resolution.exec('bash /opt/eypconf/id/description.sh').to_s -else - description = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/description ]; then cat /opt/eypconf/id/description | paste -sd,; fi\'').to_s -end - -unless description.nil? or description.empty? - Facter.add('eypconf_description') do - setcode do - description - end - end - -end diff --git a/lib/facter/eypconf_env.rb b/lib/facter/eypconf_env.rb deleted file mode 100644 index 318365c..0000000 --- a/lib/facter/eypconf_env.rb +++ /dev/null @@ -1,26 +0,0 @@ -if File.exists?('/opt/eypconf/id/env.sh') then - env = Facter::Util::Resolution.exec('bash /opt/eypconf/id/env.sh').to_s -else - env = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/env ]; then cat /opt/eypconf/id/env | paste -sd,; fi\'').to_s -end - -unless env.nil? or env.empty? - Facter.add('eypconf_env') do - setcode do - env - end - end - - Facter.add('eypconf_env_uppercase') do - setcode do - env.upcase - end - end - - Facter.add('eypconf_env_lowercase') do - setcode do - env.downcase - end - end - -end diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index 3b4da30..7b17528 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -1,6 +1,6 @@ -Dir.entries("/etc/eypconf/id").select {|f| !File.directory? f}.each do |i| +Dir.entries("/opt/eypconf/id").select {|f| !File.directory? f}.each do |i| - genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /etc/eypconf/id/#{i}'").to_s + genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /opt/eypconf/id/#{i}'").to_s if i[0]=='.' fact_name=i[1..-1] @@ -15,7 +15,7 @@ end end - Facter.add("eypconf_#{fact_name}|_uppercase") do + Facter.add("eypconf_#{fact_name}_uppercase") do setcode do genetic_id.upcase end diff --git a/lib/facter/eypconf_location.rb b/lib/facter/eypconf_location.rb deleted file mode 100644 index a2a5fab..0000000 --- a/lib/facter/eypconf_location.rb +++ /dev/null @@ -1,14 +0,0 @@ -if File.exists?('/opt/eypconf/id/description.sh') then - description = Facter::Util::Resolution.exec('bash /opt/eypconf/id/description.sh').to_s -else - description = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/description ]; then cat /opt/eypconf/id/description | paste -sd,; fi\'').to_s -end - -unless description.nil? or description.empty? - Facter.add('eypconf_description') do - setcode do - description - end - end - -end diff --git a/lib/facter/eypconf_magic_hash.rb b/lib/facter/eypconf_magic_hash.rb deleted file mode 100644 index 6935bc0..0000000 --- a/lib/facter/eypconf_magic_hash.rb +++ /dev/null @@ -1,13 +0,0 @@ -if File.exists?('/opt/eypconf/id/magic.sh') then - magichash = Facter::Util::Resolution.exec('bash /opt/eypconf/id/magic.sh').to_s -else - magichash = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/.magic ]; then cat /opt/eypconf/id/.magic | paste -sd,; else echo "deadbeef"; fi\'').to_s -end - -unless magichash.nil? or magichash.empty? - Facter.add('eypconf_magic_hash') do - setcode do - magichash - end - end -end diff --git a/lib/facter/eypconf_platformid.rb b/lib/facter/eypconf_platformid.rb deleted file mode 100644 index d482da7..0000000 --- a/lib/facter/eypconf_platformid.rb +++ /dev/null @@ -1,25 +0,0 @@ -if File.exists?('/opt/eypconf/id/platformid.sh') then - platformid = Facter::Util::Resolution.exec('bash /opt/eypconf/id/platformid.sh').to_s -else - platformid = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/platformid ]; then cat /opt/eypconf/id/platformid | paste -sd,; fi\'').to_s -end - -unless platformid.nil? or platformid.empty? - Facter.add('eypconf_platformid') do - setcode do - platformid - end - end - - Facter.add('eypconf_platformid_uppercase') do - setcode do - platformid.upcase - end - end - - Facter.add('eypconf_platformid_lowercase') do - setcode do - platformid.downcase - end - end -end diff --git a/lib/facter/eypconf_servergroup.rb b/lib/facter/eypconf_servergroup.rb deleted file mode 100644 index c43148e..0000000 --- a/lib/facter/eypconf_servergroup.rb +++ /dev/null @@ -1,25 +0,0 @@ -if File.exists?('/opt/eypconf/id/servergroup.sh') then - servergroup = Facter::Util::Resolution.exec('bash /opt/eypconf/id/servergroup.sh').to_s -else - servergroup = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/servergroup ]; then cat /opt/eypconf/id/server; fi\'') -end - -unless servergroup.nil? or servergroup.empty? - Facter.add('eypconf_servergroup') do - setcode do - servergroup - end - end - - Facter.add('eypconf_servergroup_uppercase') do - setcode do - servergroup.upcase - end - end - - Facter.add('eypconf_servergroup_lowercase') do - setcode do - servergroup.downcase - end - end -end diff --git a/lib/facter/eypconf_sg.rb b/lib/facter/eypconf_sg.rb deleted file mode 100644 index 14776bb..0000000 --- a/lib/facter/eypconf_sg.rb +++ /dev/null @@ -1,25 +0,0 @@ -if File.exists?('/opt/eypconf/id/sg.sh') then - sg = Facter::Util::Resolution.exec('bash /opt/eypconf/id/sg.sh').to_s -else - sg = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/sg ]; then cat /opt/eypconf/id/server; fi\'') -end - -unless sg.nil? or sg.empty? - Facter.add('eypconf_sg') do - setcode do - sg - end - end - - Facter.add('eypconf_sg_uppercase') do - setcode do - sg.upcase - end - end - - Facter.add('eypconf_sg_lowercase') do - setcode do - sg.downcase - end - end -end diff --git a/lib/facter/eypconf_type.rb b/lib/facter/eypconf_type.rb deleted file mode 100644 index a25997f..0000000 --- a/lib/facter/eypconf_type.rb +++ /dev/null @@ -1,25 +0,0 @@ -if File.exists?('/opt/eypconf/id/type.sh') then - nodetype = Facter::Util::Resolution.exec('bash /opt/eypconf/id/type.sh').to_s -else - nodetype = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/type ]; then cat /opt/eypconf/id/type | paste -sd,; fi\'') -end - -unless nodetype.nil? or nodetype.empty? - Facter.add('eypconf_type') do - setcode do - nodetype - end - end - - Facter.add('eypconf_type_uppercase') do - setcode do - nodetype.upcase - end - end - - Facter.add('eypconf_type_lowercase') do - setcode do - nodetype.downcase - end - end -end diff --git a/lib/facter/eypconf_userid.rb b/lib/facter/eypconf_userid.rb deleted file mode 100644 index 97c3e71..0000000 --- a/lib/facter/eypconf_userid.rb +++ /dev/null @@ -1,25 +0,0 @@ -if File.exists?('/opt/eypconf/id/userid.sh') then - userid = Facter::Util::Resolution.exec('bash /opt/eypconf/id/userid.sh').to_s -else - userid = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/userid ]; then cat /opt/eypconf/id/userid | paste -sd,; fi\'').to_s -end - -unless userid.nil? or userid.empty? - Facter.add('eypconf_userid') do - setcode do - userid - end - end - - Facter.add('eypconf_userid_uppercase') do - setcode do - userid.upcase - end - end - - Facter.add('eypconf_userid_lowercase') do - setcode do - userid.downcase - end - end -end diff --git a/metadata.json b/metadata.json index 90af06a..fbba535 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "eyp-eyplib", - "version": "0.1.22", + "version": "0.1.23", "author": "eyp", "summary": "Utility functions for puppet modules", "license": "Apache-2.0", From 11c2352a11e92b1b8364cc0e65a3f8fbae04d0a1 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 16:46:10 +0200 Subject: [PATCH 11/12] loop --- lib/facter/eypconf_generic_id.rb | 58 +++++++++++++++++--------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index 7b17528..d9941a2 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -1,37 +1,39 @@ -Dir.entries("/opt/eypconf/id").select {|f| !File.directory? f}.each do |i| +if File.exists?('/opt/eypconf/id') then + Dir.entries("/opt/eypconf/id").select {|f| !File.directory? f}.each do |i| - genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /opt/eypconf/id/#{i}'").to_s + genetic_id = Facter::Util::Resolution.exec("bash -c 'cat /opt/eypconf/id/#{i}'").to_s - if i[0]=='.' - fact_name=i[1..-1] - else - fact_name=i - end - - unless genetic_id.nil? or genetic_id.empty? - Facter.add("eypconf_#{fact_name}") do - setcode do - genetic_id - end + if i[0]=='.' then + fact_name=i[1..-1] + else + fact_name=i end - Facter.add("eypconf_#{fact_name}_uppercase") do - setcode do - genetic_id.upcase - end - end + unless genetic_id.nil? or genetic_id.empty? + Facter.add("eypconf_#{fact_name}") do + setcode do + genetic_id + end + end - Facter.add("eypconf_#{fact_name}_lowercase") do - setcode do - genetic_id.downcase - end - end + Facter.add("eypconf_#{fact_name}_uppercase") do + setcode do + genetic_id.upcase + end + end - Facter.add("eypconf_#{fact_name}_source") do - setcode do - i - end + Facter.add("eypconf_#{fact_name}_lowercase") do + setcode do + genetic_id.downcase + end + end + + Facter.add("eypconf_#{fact_name}_source") do + setcode do + i + end + end end - end + end end From 4e92157fb6eb1cb70381a6763913deda7a5550ae Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 30 Mar 2020 16:50:19 +0200 Subject: [PATCH 12/12] source file --- lib/facter/eypconf_generic_id.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/facter/eypconf_generic_id.rb b/lib/facter/eypconf_generic_id.rb index d9941a2..fbae07d 100644 --- a/lib/facter/eypconf_generic_id.rb +++ b/lib/facter/eypconf_generic_id.rb @@ -30,10 +30,9 @@ Facter.add("eypconf_#{fact_name}_source") do setcode do - i + "/opt/eypconf/id/#{i}" end end end - end end