Hey Jim, As someone who generally hates using execs unless I absolutely have to, I would recommend using the Puppet Labs registry module. I can dig out some examples tomorrow if you like.
Adam On Thursday, February 14, 2013 9:29:52 AM UTC-6, jim wrote: > > Hello all, > > I'm currently running 2.7.19 (Puppet Enterprise 2.7.0) > > I want to use puppet to add / amend or delete windows firewall rules, is > there a tidy way of doing this ???? > > exec { "Check_MK_Firewall_Rule_create": > command => 'C:\Windows\System32\netsh.exe advfirewall firewall add rule > name="Check_MK" dir=in action=allow protocol=TCP localport=6556', > unless => 'C:\Windows\System32\netsh.exe advfirewall firewall show rule > name="Check_MK"', > } > > ## If I remove the unless statement, it will keep add the same rule over > and over again, which will make the firewall rule list un-manageable > > > exec { "Check_MK_Firewall_Rule_enable": > command => 'C:\Windows\System32\netsh.exe advfirewall firewall set rule > name="Check_MK" new enable=Yes', > } > > ## When I do a puppet run it keeps running this, is there a way to only > run if disabled ??? > > Hope this make sense > > regards > > James > > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.