diff --git a/changelogs/fragments/2671-fix-broken-query-of-async_status-result.yml b/changelogs/fragments/2671-fix-broken-query-of-async_status-result.yml new file mode 100644 index 0000000000..993caaa323 --- /dev/null +++ b/changelogs/fragments/2671-fix-broken-query-of-async_status-result.yml @@ -0,0 +1,6 @@ +--- +bugfixes: + - "iptables_state - fix a broken query of ``async_status`` result + with current ansible-core development version + (https://github.com/ansible-collections/community.general/issues/2627, + https://github.com/ansible-collections/community.general/pull/2671)." diff --git a/plugins/action/system/iptables_state.py b/plugins/action/system/iptables_state.py index 96b6dc689c..887f3f47f9 100644 --- a/plugins/action/system/iptables_state.py +++ b/plugins/action/system/iptables_state.py @@ -52,7 +52,7 @@ class ActionModule(ActionBase): module_args=module_args, task_vars=task_vars, wrap_async=False) - if async_result['finished'] == 1: + if async_result.get('finished', 0) == 1: break time.sleep(min(1, timeout)) diff --git a/tests/integration/targets/iptables_state/aliases b/tests/integration/targets/iptables_state/aliases index 12765cec47..3cac4af522 100644 --- a/tests/integration/targets/iptables_state/aliases +++ b/tests/integration/targets/iptables_state/aliases @@ -5,4 +5,3 @@ skip/freebsd # no iptables/netfilter (Linux specific) skip/osx # no iptables/netfilter (Linux specific) skip/macos # no iptables/netfilter (Linux specific) skip/aix # no iptables/netfilter (Linux specific) -disabled # FIXME