Ask Your Question
0

windows firewall - create rules

asked 2014-01-08 14:33:41 -0500

amarzi gravatar image

updated 2014-01-08 14:34:12 -0500

My code is as follows:

class windows-iis::firewall {

        exec { 'TCP Port 25777':
                command => 'C:/Windows/System32/netsh.exe advfirewall firewall add rule name="Allow TCP 25777" dir=in action=allow protocol=tcp localport=25777',
                creates => 'C:/Windows/system32/netsh.exe advfirewall firewall show rule name="Allow TCP 25777"'
        }
        exec { 'TCP Port 25888':
                command => 'C:/Windows/System32/netsh.exe advfirewall firewall add rule name="Allow TCP 25888" dir=in action=allow protocol=tcp localport=25888',
                creates => 'C:/Windows/System32/netsh.exe advfirewall firewall show rule name="Allow TCP 25888"'
        }
}

# This script will open ports on the firewall for web app installations ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-01-08 17:47:59 -0500

fnaard gravatar image

There are a couple of modules on the forge that will manage the windows firewall, without needing to write your own. Take a look, for instance, at http://forge.puppetlabs.com/liamjbennett/windows_firewall

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-01-08 14:33:41 -0500

Seen: 677 times

Last updated: Jan 08 '14