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 '{ print $2 }' | /bin/cut -d':' -f2")
end
end
Now my Windows Version:
Facter.add("ip_foo_windows") do
confine :operatingsystem => :windows
setcode do
Facter::Util::Resolution.exec("C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ipconfig | Select-String -pattern '192.168.20[567]' | %{$_.line.split()} | FINDSTR 192.168.20[567]")
end
end
When i run the command C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ipconfig | Select-String -pattern '192.168.20[567]' | %{$_.line.split()} | FINDSTR 192.168.20[567] on the box it works perfectly fine. It returns the value that i need.
But it seems that puppet doesn't get that value into the fact.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/65472ec1-fe7d-4a83-a144-9534419c78e3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f0fbe47f-5bc0-4fc3-bc2a-5eb8d6cad367%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f0fbe47f-5bc0-4fc3-bc2a-5eb8d6cad367%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
The File System Redirector will silently redirect all file system access to%windir%\system32
to%windir%\SysWOW64
instead. This can be an issue when trying to manage files in the system directory, e.g., IIS configuration files. In order to prevent redirection, you can use thesysnative
alias, e.g.C:\Windows\sysnative\inetsrv\config\application Host.config
.