Skip to content

Instantly share code, notes, and snippets.

@blackknight36
Last active March 10, 2017 02:46
Show Gist options
  • Save blackknight36/0035bc27e2f0f4b86c13f9657cd942e0 to your computer and use it in GitHub Desktop.
Save blackknight36/0035bc27e2f0f4b86c13f9657cd942e0 to your computer and use it in GitHub Desktop.
Facter.add(:sensor_list) do
confine :kernel => 'Linux'
if Facter.value(:virtual) == 'physical'
sensors = Facter::Core::Execution.exec("sensors | egrep '.*-.*-'")
sensors.split("\n") if sensors != nil
else
sensors = nil
sensors
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment