change data type + default value of updatefreq to Numeric #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the module supports setting the alias attribute "updatefreq" to an empty string. However, this causes Puppet to alter the affected alias on every Puppet run:
This happens because OPNsense expects only numeric values for "updatefreq":
https://github.com/opnsense/core/blob/6ca0e5b58f2049d09d9776fbce31cfd785dfeea9/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.xml#L70-L72
Empty strings are still accepted, but are internally converted to
0by OPNsense.So in order to solve this, this PR does two things:
0(the default value that is internally enforced by OPNsense)This change is fully backwards-compatible, because it just sets the same value that is already enforced by OPNsense. However, an alias that was previously relying on the old default value (empty string) will see the following change on the next Puppet run:
All following Puppet runs will be completely silent. :)
(Side note: This behaviour seems to be newish, it probably started in OPNsense 22.7 and I'd assume that it is related to the phalcon/PHP upgrades. In older versions of OPNsense an emptry string for "updatefreq" was actually written to config.xml and not replaced with a
0.)