mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 23:25:28 +01:00
Use get_zone_config_dict when firewalld >= 0.9.0 so forward setting is passed correctly
This commit is contained in:
parent
d4c3aef803
commit
b3b0db9189
1 changed files with 10 additions and 3 deletions
|
|
@ -126,6 +126,13 @@ class FirewallTransaction(object):
|
|||
def get_fw_zone_settings(self):
|
||||
if self.fw_offline:
|
||||
fw_zone = self.fw.config.get_zone(self.zone)
|
||||
|
||||
# If firewalld version is 0.9.0 or higher retrieve the configuration
|
||||
# using the get_zone_config_dict call, otherwise the returned value
|
||||
# for the 'forward' field is always zero.
|
||||
if LooseVersion(FW_VERSION) >= LooseVersion("0.9.0"):
|
||||
fw_settings = FirewallClientZoneSettings(self.fw.config.get_zone_config_dict(fw_zone))
|
||||
else:
|
||||
fw_settings = FirewallClientZoneSettings(
|
||||
list(self.fw.config.get_zone_config(fw_zone))
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue