-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce85023
commit 74402b4
Showing
6 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# CHANGELOG | ||
|
||
## 0.1.8 | ||
|
||
* added **eypconf** facts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
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 | ||
|
||
unless magichash.nil? or magichash.empty? | ||
Facter.add('eypconf_magic_hash') do | ||
setcode do | ||
magichash | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
userid = Facter::Util::Resolution.exec('bash -c \'if [ -f /opt/eypconf/id/customer ]; then cat /opt/eypconf/id/customer | paste -sd,; else echo "defaultcustomer"; fi\'').to_s | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters