forked from tinuva/firewalld-formula
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not error on unknown os_family grain
If the formula was ran on a system that reported an os_family that wasn't one of "Debian", "RedHat", "Arch", "Suse" then the map.jinja template would fail to render with "'NoneType' is not iterable. This occurs because grains.filter_by will return None when it fails match the grain to the input dictionary. The value is then blindly passed into a dict.update() which causes the failure. In this patch we ensure that the default values, as defined in defaults.yaml, are always applied when grain matching fails.
- Loading branch information
Showing
3 changed files
with
34 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
--- | ||
firewalld: | ||
enabled: true | ||
package: firewalld | ||
service: firewalld | ||
config: /etc/firewalld.conf | ||
default: | ||
firewalld: | ||
enabled: true | ||
package: firewalld | ||
service: firewalld | ||
config: /etc/firewalld.conf | ||
|
||
ipset: | ||
manage: false | ||
pkg: ipset | ||
ipset: | ||
manage: false | ||
pkg: ipset | ||
|
||
backend: | ||
manage: false | ||
pkg: nftables | ||
backend: | ||
manage: false | ||
pkg: nftables | ||
|
||
ipsets: {} | ||
ipsets: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# -*- coding: utf-8 -*- | ||
# # vim: ft=yaml | ||
# os_family defaults | ||
# only add key:values here that differ from whats in defaults.yaml | ||
--- | ||
Debian: | ||
firewalld: {} | ||
RedHat: | ||
firewalld: {} | ||
Arch: | ||
firewalld: {} | ||
Suse: | ||
firewalld: {} |