Re: [Puppet Users] Custom Windows Fact (match ipaddress)

2013-11-11 Thread cko
I still can't get it to work: Facter::Util::Resolution.exec("C:\\Windows\\System32\\cmd.exe /c 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe ipconfig | Select-String -pattern '192.168.20[567]' | %{$_.line.split()} | FINDSTR 192.168.20[567]'") On Wednesday, October 30, 20

Re: [Puppet Users] Custom Windows Fact (match ipaddress)

2013-10-30 Thread Josh Cooper
The second issue is that findstr is a shell builtin, so you have wrap the entire command in: cmd.exe /c You may have to quote the original command and adjust the interior quotes accordingly. Josh On Wednesday, October 30, 2013, cko wrote: > Still no effect. > > > Facter::Util::Resolution.exec

Re: [Puppet Users] Custom Windows Fact (match ipaddress)

2013-10-29 Thread Josh Cooper
On Tuesday, October 29, 2013, cko wrote: > Hi everybody, > > I'm trying to write a custom fact that gets the IP Address of any given > NIC if it matches a specific IP range. > > On Linux i use this (works fine) > > Facter.add("ip_foo") do >setcode do > Facter::Util::Resolution.exec("/sbi

[Puppet Users] Custom Windows Fact (match ipaddress)

2013-10-29 Thread cko
Hi everybody, I'm trying to write a custom fact that gets the IP Address of any given NIC if it matches a specific IP range. On Linux i use this (works fine) Facter.add("ip_foo") do setcode do Facter::Util::Resolution.exec("/sbin/ifconfig | /bin/grep '192.168.20[567].' | /bin/awk '{