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

Add firewall_backend option #252

Merged
merged 3 commits into from
Feb 12, 2020
Merged

Add firewall_backend option #252

merged 3 commits into from
Feb 12, 2020

Conversation

florianfa
Copy link
Contributor

Pull Request (PR) description

add option FirewallBackend to firewalld

This Pull Request (PR) fixes the following issues

Fixes #235

@florianfa florianfa requested review from crayfishx and removed request for crayfishx February 4, 2020 08:02
README.md Outdated
@@ -31,6 +31,7 @@ class { 'firewalld': }
* `service_ensure`: Whether the service should be running or not (default: running)
* `service_enable`: Whether to enable the service
* `default_zone`: Optional, set the default zone for interfaces (default: undef)
* `firewallbackend`: Optional, set the firewall backend for firewalld (default: undef)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest changing to firewall_backend to match the current pattern and read easier.

}
end

it do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please add similar under the context 'with defaults for all parameters' that shows it is_expected.not_to contain_augeas('firewalld::firewallbackend')

@ghoneycutt
Copy link
Member

Great PR, thank you! Have a couple small changes and this should be good to merge.

@ghoneycutt
Copy link
Member

Could you please add a couple acceptance tests that shows firewalld running with iptables and nftables? That would help ensure this stays supported.

@@ -235,6 +236,15 @@
}
}

if $firewall_backend {
augeas {
'firewalld::firewall_backend':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only valid in firewalld >= 0.6.0 and will cause an error in the logs about unsupported options on versions less than that. Take this, it's dangerous to go alone #255

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a style perspective this should read like

augeas { 'firewalld::firewall_backend':
  changes => ["set FirewallBackend \"${firewall_backend}\"",],
}

@trevor-vaughan
Copy link
Collaborator

I've added a patch here that should take care of things. Happy to push it directly if @florianfa wants to enable pushes from maintainers.
patch_for_firewalld_version_fact.txt

@florianfa
Copy link
Contributor Author

florianfa commented Feb 12, 2020

Hello trevor-vaughan,
pushes/edit from maintainers should be already allowed (Checkbox Allow edits from maintainers.).
@ghoneycutt : If it's possible for me I will try to add some acceptance tests.

Regards,
Florian

* Added support for firewalld_version fact
* Updated spec tests
* Aligned parameters in init.pp
* Rubocop fixes are in the EL8 PR
@alexjfisher alexjfisher added the enhancement New feature or request label Feb 12, 2020
Optional[String] $default_service_zone = undef,
Optional[String] $default_port_zone = undef,
Optional[String] $default_port_protocol = undef,
Enum['present','absent','latest','installed'] $package_ensure = 'installed',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the propensity for data types to be quite long, aligning them can get pretty crazy. It also causes a lot of needless code churn that makes reviews harder to do.

@ghoneycutt ghoneycutt merged commit 10cedfd into voxpupuli:master Feb 12, 2020
@alexjfisher alexjfisher changed the title #235 Backend Firewall Add firewall_backend option Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backend Firewall
4 participants