Created
March 2, 2018 20:17
-
-
Save iversond/8f9abc5d80aab1c96d08e7ddbfb631c8 to your computer and use it in GitHub Desktop.
Custom facter fact to return the first 2 characters as the Fact `app`
This file contains hidden or 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
Facter.add(:app) do | |
setcode do | |
app = Facter.value(:hostname)[0..1] | |
if app.downcase.match(/lm/) | |
app = "hr" | |
end | |
app.downcase | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment