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

Create a fact to report on ruby architecture

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: FACT 2.3.0
    • Component/s: DOCS
    • Labels:
    • Template:
    • Story Points:
      1
    • Sprint:
      Platform 2014-10-15

      Description

      If a user tries to write manifests that work correctly on both x86 and x64 Windows, when file system redirection is enabled (x86) and not (x64), they need to be able to conditionally define file resources. For example, on x86:

      file { 'c:/windows/sysnative/myfile.txt':
        ensure => file
      }
      

      And on x64:

      file { 'c:/windows/system32/myfile.txt':
        ensure => file
      }
      

      Unfortunately, you can't use sysnative for both x86 and x64, it's only available when filesystem redirection is enabled.

      In order to make this conditional, manifest authors need to be able to select on a fact value. We cannot use the architecture fact, since that is the architecture of the operating system, and not the architecture of the ruby process.

      One option is to look at the RUBY_PLATFORM constant which returns on x86:

      irb(main):001:0> RUBY_PLATFORM
      => "i386-mingw32"
      

      On x64:

      irb(main):001:0> RUBY_PLATFORM
      => "x64-mingw32"
      

      A work around would be to look for "(x86)" in the path fact, though it's not guaranteed to correctly identify the ruby architecture.

      This issue is somewhat mitigated by:

      1. 2008R2 and up are only 64-bit operating systems. Only consumer versions (windows 7, 8, etc) and earlier server versions (2003, 2003R2, and 2008) support 32-bit versions.
      2. Puppet x64 is not supported on 2003

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                josh Josh Cooper
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support