Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-2740

'gce' fact missing in Facter 4.x

    XMLWordPrintable

    Details

    • Template:
    • Team:
      Night's Watch
    • Sub-team:
    • Story Points:
      3
    • Sprint:
      ghost-19, ghost-26.08
    • Method Found:
      Needs Assessment
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      Needs Assessment

      Description

      The Problem

      The core fact 'gce' is missing from Facter 4 when run on a Google Cloud instance.

      The Expectation

      I expected a Google Cloud instance to have a 'gce' fact that resolves to the metadata of the GCE instance just like it does in Facter 3.

      https://puppet.com/docs/facter/3.11/core_facts.html#gce

      The Reproduction

      On a GCE instance, start with Facter 3.x that ships with puppet-agent 5 or 6:

      $ facter --version
      3.11.8 (commit eb5f71136af5012f3a7169ed3a77a111c1e4d765)
      $ facter gce | head
      {
        instance => {
          attributes => {
            boot-script => "#!/usr/bin/python
       
      # Read this for more information on the startup-script process
      # https://cloud.google.com/deployment-manager/docs/step-by-step-guide/setting-metadata-and-startup-scripts
       
      import fcntl
      import json
       
      $ facter gce --json | jq '.gce | keys'
      [
        "instance",
        "oslogin",
        "project"
      ]
      

      Then install the Facter 4.0.33 gem and run facter gce:

      $ sudo /opt/puppetlabs/puppet/bin/gem install facter-4.0.33.gem thor-1.0.1.gem hocon-1.3.1.gem --no-doc
      Successfully installed hocon-1.3.1
      facter's executable "facter" conflicts with /opt/puppetlabs/puppet/bin/facter
      Overwrite the executable? [yN]  y
      Successfully installed facter-4.0.33
      Successfully installed thor-1.0.1
      Successfully installed hocon-1.3.1
      4 gems installed
       
      $ facter --version
      4.0.33
       
      $ facter gce
       
      $
      

        Attachments

          Activity

            People

            Assignee:
            andrei.filipovici Andrei Filipovici
            Reporter:
            natemccurdy Nate McCurdy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support