(#17612) Follow Google docs to populate virtual => gce#376
Merged
jeffmccune merged 2 commits intopuppetlabs:1.7.xfrom Dec 12, 2012
Merged
Conversation
Without this patch the virtual fact does not return a value that specifically identifies Google Compute Engine. This is a problem because configuration decisions may depend on if the resources being configured exist within GCE or not. This patch addresses the problem by changing the behavior of the `virtual` fact to return the value `gce` when running in Google Compute Engine's cloud. This patch uses the Google recommended and documented way to detect if we are running on a Google Compute Engine: https://developers.google.com/compute/docs/instances#dmi
Without this patch applied Facter uses lspci to determine if the system is running in the Google Compute Engine virtual environment. This is a problem because Google recommends parsing the output of /sys/firmware/dmi/entries/1-0/raw as per [Detecting if You Are Running in Google Compute Engine](https://developers.google.com/compute/docs/instances#dmi). `lspci` may be unreliable over time. This patch addresses the problem by adding a higher weight fact that scans `/sys/firmware/dmi/entries/1-0/raw` as recommended by Google. The fact is confined to Linux and disables itself if `/sys/firmware/dmi/entries/1-0/raw` does not exist in the filesystem.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without this patch applied Facter uses lspci to determine if the system
is running in the Google Compute Engine virtual environment. This is a
problem because Google recommends parsing the output of
/sys/firmware/dmi/entries/1-0/raw as per Detecting if You Are Running
in Google Compute
Engine.
lspcimay be unreliable over time.This patch addresses the problem by adding a higher weight fact that
scans
/sys/firmware/dmi/entries/1-0/rawas recommended by Google. Thefact is confined to Linux and disables itself if
/sys/firmware/dmi/entries/1-0/rawdoes not exist in the filesystem.