Skip to content

Instantly share code, notes, and snippets.

@dnase
Created March 16, 2017 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnase/f363a8136ae80954c1639cdcebdd5e7c to your computer and use it in GitHub Desktop.
Save dnase/f363a8136ae80954c1639cdcebdd5e7c to your computer and use it in GitHub Desktop.
Facter.add(:cloud) do
setcode do
ip = Facter.value(:ipaddress)
octets = ip.split('.')
case octets[2]
when '5'
'Oracle'
when '9'
'Azure'
else
'Unknown'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment