Skip to content

Commit

Permalink
Fix network DNS enable idempotency issue
Browse files Browse the repository at this point in the history
Signed-off-by: Sagi Shnaidman <[email protected]>
  • Loading branch information
sshnaidm committed Sep 28, 2023
1 parent 2a8aaf4 commit dcc4277
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/modules/podman_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,15 @@ def _diff_update_and_compare(self, param_name, before, after):
def diffparam_disable_dns(self):
# For v3 it's impossible to find out DNS settings.
if LooseVersion(self.version) >= LooseVersion('4.0.0'):
before = not self.info.get('dns_enabled', True)
if self.info.get('driver') == 'bridge':
before = not self.info.get('dns_enabled', True)
# for all other drivers except bridge DNS is disabled by default
else:
before = False
after = self.params['disable_dns']
# compare only if set explicitly
if self.params['disable_dns'] is None:
after = before
return self._diff_update_and_compare('disable_dns', before, after)
before = after = self.params['disable_dns']
return self._diff_update_and_compare('disable_dns', before, after)
Expand Down

0 comments on commit dcc4277

Please sign in to comment.