Skip to content
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

Automanage firewall indices #362

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

lkubb
Copy link

@lkubb lkubb commented Apr 27, 2023

Currently, it's a very error-prone and manual process to ensure firewall rules are applied in a specific order (unless I'm missing something – always happy to learn :)).

This PR
a) allows the rule index to not be specified and attempts to autodiscover an unoccupied one
b) introduces a new resource (unifi_firewall_ruleset) that manages the ordering of firewall rules.

I'm not sure if this is the best approach, but I did not think a substantial change to how firewall rules are managed currently would be worth the trouble.

This resource is virtual and will be auto-imported during creation. There can only be a single resource per site + ruleset combination. It requires all rule IDs that are present in the ruleset to be specified and disallows managing rule indices if it discovers unknown rules.

Fixes: #361

This requires paultyng/go-unifi#127, I will need to update this PR when that one is released.

@lkubb lkubb force-pushed the ruleset-resource branch 2 times, most recently from 34b8765 to 9e807fd Compare April 27, 2023 16:44
@lkubb
Copy link
Author

lkubb commented Sep 14, 2023

@paultyng @joshuaspence Any chance of getting a new go-unifi release and this provider being updated to be able to use it anytime soon? This PR relies on changes that were merged in June, but are still unreleased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Firewall rule indices: FirewallRuleIndexExisted
1 participant