From 22d73279c4d5e4f481e5c2ff1108a9f34ee531cd Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Wed, 16 Oct 2019 13:38:25 +0200 Subject: [PATCH 1/4] location fuck --- CHANGELOG.md | 4 ++++ lib/facter/eypconf_location.rb | 14 ++++++++++++++ .../{eypconf_platform.rb => eypconf_platformid.rb} | 0 metadata.json | 2 +- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 lib/facter/eypconf_location.rb rename lib/facter/{eypconf_platform.rb => eypconf_platformid.rb} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37c7277..9508e7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 0.1.22 + +* added **eypconf_location** + ## 0.1.21 * added double empty line at the end of the autobanner file diff --git a/lib/facter/eypconf_location.rb b/lib/facter/eypconf_location.rb new file mode 100644 index 0000000..a2a5fab --- /dev/null +++ b/lib/facter/eypconf_location.rb @@ -0,0 +1,14 @@ +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_platform.rb b/lib/facter/eypconf_platformid.rb similarity index 100% rename from lib/facter/eypconf_platform.rb rename to lib/facter/eypconf_platformid.rb diff --git a/metadata.json b/metadata.json index cef2dc4..90af06a 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "eyp-eyplib", - "version": "0.1.21", + "version": "0.1.22", "author": "eyp", "summary": "Utility functions for puppet modules", "license": "Apache-2.0", From 3309511927732a1329d03242946da3fe287fb7b8 Mon Sep 17 00:00:00 2001 From: jordiprats Date: Tue, 24 Mar 2020 08:38:56 +0100 Subject: [PATCH 2/4] 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 3/4] 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 4/4] 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",