-
Notifications
You must be signed in to change notification settings - Fork 457
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
(CAT-376) Rework firewall module to use the resource_api #1145
(CAT-376) Rework firewall module to use the resource_api #1145
Conversation
e7731c0
to
e067e01
Compare
4143d8d
to
ccd6486
Compare
ccd6486
to
cff3a04
Compare
a8affb5
to
91b2ee4
Compare
CentOS 8 failures have appeared on nightly, |
Remove all old code from the module
- support for IPv4 (CAT-683) - support for IPv6 (CAT-961)
- support for IPv4 (CAT-684) - support for IPv6 (CAT-961) - support for all attributes (CAT-960)
Update acceptance testing to account for changes. Includes: - standard_usage_spec.rb - rules_spec.rb - resource_cmd_spec.rb - firewallchain_spec.rb - firewall_duplicate_comment_spec.rb
Update acceptance testing to account for changes. Includes: - class_spec.rb - firewall_attributes_exceptions_spec.rb - firewall_attributes_happy_path_spec.rb - firewall_attributes_ipv6_exceptions_spec.rb - firewall_attributes_ipv6_happy_path_spec.rb
Unit test coverage for utility functions found within the puppet_x namespace
Test coverage for the firewall and firewallchain Types
Test separated out into three files due to the size and complexity of the provider.
Actionable errors left in file will be handled by a follow-up PR
77b5dd6
to
4a72aab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a resource_api expert, but the changes look good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Dont forget to remove the Do Not Merge
The action parameter going ? Is that necessary ? If it could live till EOL for EL7? |
@traylenator The functionality behind the attribute is still there, it just means renaming the attribute your setting to jump instead. As a side, any reason for E7 in particular? |
Thanks for the reply - will live with the status quo till we launch EL7 into oblivion (and drop this module). |
Add Requires on puppet-resource_api It's needed since the merge of [1] [1] puppetlabs/puppetlabs-firewall#1145 (cherry picked from commit 0b245d6) Change-Id: Id033e1418a4696726382b4ceeb684ae0afa3d253
It's needed since the merge of [1] [1] puppetlabs/puppetlabs-firewall#1145 Change-Id: If156134ecf968b98578a57dbe14030a1a8c93174
Summary
This PR has been created to update the Firewall module to utilize the resource_api, with the intention being to increase the ease with which the module can be updated and managed in the future.
As part of this several backwards incompatible changes where made, including:
provider
attribute with the Firewall type has been renamedprotocol
, due to both the resource_api forbidding the use of this as an attribute name and to bring it in line with the Firewallchain. Though it continues to accept bothiptables
andip6tables
alongsideIPv4
andIPv6
, this may change in the future.action
attribute has been removed as it managed the same function as thejump
attribute, only on a more limited scale. Though this was given a reason, to enforce the use of generic parameters, I found this to be a needlessly complex addition to the code.port
attribute has been removed as it was deprecated several years ago.dport
/sport
ranges should be passed with:
as a separator as this is the valid form of input for the flag. Code has been updated to allow the original separator-
, though it is not preferred.sport
/dport
, that require negation to be universal among all passed values have been updated so that rather than negating each and every value passed you now simply negate the first value in the array in order to negate them all, although the original form of negating each and every value is still allowed. Certain array values such assrc_type
/dst_type
differ however and necessitate that each value be negated, or not negated as it were, separately.**NOTES:
puppet-resource_api
functionality to be merged and released: (CAT-761) Add custom_generate as a feature puppet-resource_api#316 -->puppet-resource_api
change has been merged and released (v1.9.0), waiting on update topuppet-agent
to include this new version so that I can turn on the automated tests (CAT-761) Update puppet-resource_api version puppet-agent#2383 --> PR has been merged and will be included in7.26.0
and8.2.0
--> tests enabledChecklist
puppet apply
)