Skip to content

Commit

Permalink
Merge pull request #30 from jordiprats/master
Browse files Browse the repository at this point in the history
eypconf fact generation
  • Loading branch information
jordiprats authored Mar 30, 2020
2 parents 334a7b6 + 4e92157 commit 6af2da5
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 218 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.1.23

* simplified **eypconf** fact generation

## 0.1.22

* added **eypconf_location**
Expand Down
25 changes: 0 additions & 25 deletions lib/facter/eypconf_customer.rb

This file was deleted.

14 changes: 0 additions & 14 deletions lib/facter/eypconf_description.rb

This file was deleted.

26 changes: 0 additions & 26 deletions lib/facter/eypconf_env.rb

This file was deleted.

38 changes: 38 additions & 0 deletions lib/facter/eypconf_generic_id.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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

if i[0]=='.' then
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
end

Facter.add("eypconf_#{fact_name}_uppercase") do
setcode do
genetic_id.upcase
end
end

Facter.add("eypconf_#{fact_name}_lowercase") do
setcode do
genetic_id.downcase
end
end

Facter.add("eypconf_#{fact_name}_source") do
setcode do
"/opt/eypconf/id/#{i}"
end
end
end
end
end
14 changes: 0 additions & 14 deletions lib/facter/eypconf_location.rb

This file was deleted.

13 changes: 0 additions & 13 deletions lib/facter/eypconf_magic_hash.rb

This file was deleted.

25 changes: 0 additions & 25 deletions lib/facter/eypconf_platformid.rb

This file was deleted.

25 changes: 0 additions & 25 deletions lib/facter/eypconf_servergroup.rb

This file was deleted.

25 changes: 0 additions & 25 deletions lib/facter/eypconf_sg.rb

This file was deleted.

25 changes: 0 additions & 25 deletions lib/facter/eypconf_type.rb

This file was deleted.

25 changes: 0 additions & 25 deletions lib/facter/eypconf_userid.rb

This file was deleted.

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.22",
"version": "0.1.23",
"author": "eyp",
"summary": "Utility functions for puppet modules",
"license": "Apache-2.0",
Expand Down

0 comments on commit 6af2da5

Please sign in to comment.