From 3309511927732a1329d03242946da3fe287fb7b8 Mon Sep 17 00:00:00 2001 From: jordiprats Date: Tue, 24 Mar 2020 08:38:56 +0100 Subject: [PATCH 1/3] added SG --- lib/facter/eypconf_sg.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/facter/eypconf_sg.rb diff --git a/lib/facter/eypconf_sg.rb b/lib/facter/eypconf_sg.rb new file mode 100644 index 0000000..14776bb --- /dev/null +++ b/lib/facter/eypconf_sg.rb @@ -0,0 +1,25 @@ +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 From f468d101835f92f8e07f37cb8f4241d730b8028c Mon Sep 17 00:00:00 2001 From: jordiprats Date: Tue, 24 Mar 2020 08:39:47 +0100 Subject: [PATCH 2/3] sg metadata --- CHANGELOG.md | 4 ++++ metadata.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9508e7d..a991dee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 0.1.23 + +* added **eypconf_sg** fact (servergroup shortname) + ## 0.1.22 * added **eypconf_location** 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 c16551238aa391677e856722e444a78f2d7e1262 Mon Sep 17 00:00:00 2001 From: jordiprats Date: Tue, 24 Mar 2020 08:41:08 +0100 Subject: [PATCH 3/3] merge releases --- CHANGELOG.md | 5 +---- metadata.json | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a991dee..b023eca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,9 @@ # CHANGELOG -## 0.1.23 - -* added **eypconf_sg** fact (servergroup shortname) - ## 0.1.22 * added **eypconf_location** +* added **eypconf_sg** fact (servergroup shortname) ## 0.1.21 diff --git a/metadata.json b/metadata.json index fbba535..90af06a 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "eyp-eyplib", - "version": "0.1.23", + "version": "0.1.22", "author": "eyp", "summary": "Utility functions for puppet modules", "license": "Apache-2.0",