-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule delete doesnt appear to be working. #30
Comments
Hello, Did you create the rule with Puppet or manually ? Can you give the output of those commands? Regards, |
Hi Alex, Rule was created by hand to test this. Interesting output from those commands PS C:> puppet resource windows_firewall_rule 'test'
PS C:> Get-NetFirewallRule -DisplayName 'test' Name : {c2ab7554-e6c9-49ed-92f5-2cd830f8236a} |
Puppet module is using firewall rule name as identifier because it's unique. But if you have created the rule using puppet, it should have populated the name correctly (Module is using the resource title as firewall name by default) Can you please share the puppet code you use to create the firewall rule? Could you please also try this to delete the test one ?
|
Sorry..i had misread your response and edited my post a bit after. My rule was created by hand. Using the InstanceID does get the test rule clobbered. Doesn't look like this will work for my specific use case this time around (I'm trying to delete a rule created by an app) but its good to know i can kill ones that i have previously created with this module easily enough. Thanks! edit: on a side note I now know why I was unable to edit that same stupid app created rule to look like I wanted after it was created. Couldn't figure out what i was doing wrong but its the same as with the delete |
Can you give more context on your use case? Using the purge feature can maybe be a solution but it's requiring a new release that will accept some arguments to purge specific rules |
I have an app im deploying (via puppet and choco) that creates its own firewall rules when it installs. The issue is that app makes its rule incompletely so im trying to have the module delete the rule the app makes on its own and replace it with one that's correct. The second part works great but the first part doesn't. Not the end of the world and its more of a cleanup and tidy thing for me. |
Add a rule called test
Ask it to be deleted via:
windows_firewall_rule { 'test':
ensure => absent;
}
Expected that rule will be removed but it isn't being deleted.
Win 11
The text was updated successfully, but these errors were encountered: