Skip to content

Commit

Permalink
added servergroup
Browse files Browse the repository at this point in the history
  • Loading branch information
jordiprats committed Dec 7, 2017
1 parent 678e141 commit 59b3a2f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## 0.1.10

* added **eypconf_group** fact
* added **eypconf_servergroup** fact

## 0.1.9

* removed bool2httpd function
* removed **bool2httpd** function

## 0.1.8

Expand Down
25 changes: 0 additions & 25 deletions lib/facter/eypconf_group.rb

This file was deleted.

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

0 comments on commit 59b3a2f

Please sign in to comment.