Created
January 28, 2009 02:16
-
-
Save btm/53776 to your computer and use it in GitHub Desktop.
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
# get vmware host servername via guestinfo (provided we've already set it) and create an attribute | |
require 'facter' | |
if File.file?("/usr/sbin/vmware-guestd") | |
vmwarehost = IO.popen("/usr/sbin/vmware-guestd --cmd 'info-get guestinfo.host'") { |io| io.gets } | |
if vmwarehost | |
replace_attrib("vmwarehost", vmwarehost.chomp) | |
end | |
end | |
# add tag if we detect that we're vmware guest | |
if Facter.value(:productname) == "VMware Virtual Platform" | |
add_tag("vmware-guest") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment