voxpupuli / puppet-windows_firewall

puppet module for configuring the windows firewall
https://forge.puppet.com/puppet/windows_firewall
MIT License
16 stars 55 forks source link

windows_firewall::exception program validation doesn't allow windows %VAR% #93

Open nmaludy opened 5 years ago

nmaludy commented 5 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

    windows_firewall::exception { 'SNMP Service (UDP In)':
      direction    => 'in',
      action       => 'allow',
      protocol     => 'UDP',
      local_port   => 161,
      remote_port  => 'any',
      program      => '%SystemRoot%\system32\snmp.exe',
      display_name => 'SNMP Service (UDP In)',
      description  => @(EOT)
        Managed by Puppet. Inbound rule for the Simple Network Management Protocol
        (SNMP) Service to allow SNMP traffic. [UDP 161]
        | EOT
    }

What are you seeing

Error: Could not retrieve catalog from remote server:
Error 500 on SERVER: Server Error: Evaluation Error:
Error while evaluating a Resource Statement,
Evaluation Error: Error while evaluating a Function Call, "%SystemRoot%\\system32\\snmp.exe" is not an absolute path.
(file: /etc/puppetlabs/code/environments/development/modules/windows_firewall/manifests/exception.pp, line: 139, column: 7)
(file: /etc/puppetlabs/code/environments/development/modules/xxx/manifests/profile/windows/snmp.pp, line: 66) on node nickwindows.domain.tld
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

What behaviour did you expect instead

I expected to be able to enter in paths with Windows %VAR% format for the program parameter

Any additional information you'd like to impart

The default rule for SNMP has this exact configuration and i was trying to mirror it so that it's managed in Puppet:

image