The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Porting Puppet and Facter to MSWin

This page is used as a whiteboard / shared note space by the developers working on porting Puppet and Facter to MS Windows.

Things You Should Not Do

  1. Use system calls
  2. Attempt to parse the output of system calls

Providers written.

Providers that need to be written.

  • Registry provider

Parts of the Standard Library You Can Rely On For MS Windows

  • win32ole
  • win32/registry
  • win32/resolv
  • Win32API

Parts of the Standard Library You Cannot Rely On For MS Windows

  • Just about everything else

Specific Problems

  • etc – Only 1 method works on MS Windows
  • pathname – Doesn’t handle UNC paths properly
  • resolv – Not to be trusted; use win32-resolv instead
  • open3 – Does not work with Ruby 1.8.x on MS Windows

How To Obtain System Information On MS Windows

  • Virtually everything you could ever want to know about the system can be most easily obtained using the WMI interface.
  • You can obtain information from WMI using the win32ole library.

How To Check For Windows

require 'rbconfig'
Config::CONFIG['host_os'] =~ /mswin|win32|msdos|cygwin|mingw/i