Repository: ansible-collections/community.general

Issue:
iptables_state is broken again on ansible/ansible's devel branch
### Summary

I think this time it's due to https://github.com/ansible/ansible/commit/9c718ccc4288473d44ebf13599a409913d43e3cc

See https://dev.azure.com/ansible/b24bf3ca-6168-45d7-99e2-bf8029e67c87/_apis/build/builds/16908/logs/1600 and https://dev.azure.com/ansible/b24bf3ca-6168-45d7-99e2-bf8029e67c87/_apis/build/builds/16908/logs/1583 for CI runs.


### Issue Type

Bug Report

### Component Name

iptables_state

### Ansible Version

devel

### Configuration

*

### OS / Environment

*

### Steps to Reproduce

*

### Expected Results

*

### Actual Results

```
2021-06-03T19:23:06.1341094Z 03:51 TASK [iptables_state : restore state (must report a change, async, no warning)] ***
2021-06-03T19:23:06.1343351Z 03:51 [1;30mtask path: /root/ansible_collections/community/general/tests/output/.tmp/integration/iptables_state-jh1d92lw-ÅÑŚÌβŁÈ/tests/integration/targets/iptables_state/tasks/tests/00-basic.yml:238[0m
2021-06-03T19:23:06.1450331Z 03:51 [0;34m<testhost> ESTABLISH LOCAL CONNECTION FOR USER: root[0m
2021-06-03T19:23:06.1451596Z 03:51 [0;34m<testhost> EXEC /bin/sh -c 'echo ~root && sleep 0'[0m
2021-06-03T19:23:06.1513048Z 03:51 [0;34m<testhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1622748186.1474516-19494-19983167396933 `" && echo ansible-tmp-1622748186.1474516-19494-19983167396933="` echo /root/.ansible/tmp/ansible-tmp-1622748186.1474516-19494-19983167396933 `" ) && sleep 0'[0m
2021-06-03T19:23:06.1652939Z 03:51 [0;34mUsing module file /root/ansible_collections/community/general/plugins/modules/iptables_state.py[0m
2021-06-03T19:23:06.1654089Z 03:51 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpbl57rmac TO /root/.ansible/tmp/ansible-tmp-1622748186.1474516-19494-19983167396933/AnsiballZ_iptables_state.py[0m
2021-06-03T19:23:06.2542603Z 03:51 [0;34mIncluding module_utils file ansible/__init__.py[0m
2021-06-03T19:23:06.2543882Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/__init__.py[0m
2021-06-03T19:23:06.2544626Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/_text.py[0m
2021-06-03T19:23:06.2576030Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/basic.py[0m
2021-06-03T19:23:06.2577767Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/_collections_compat.py[0m
2021-06-03T19:23:06.2579119Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/__init__.py[0m
2021-06-03T19:23:06.2580448Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/_json_compat.py[0m
2021-06-03T19:23:06.2581717Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/_utils.py[0m
2021-06-03T19:23:06.2583377Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/arg_spec.py[0m
2021-06-03T19:23:06.2588426Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/file.py[0m
2021-06-03T19:23:06.2592893Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/parameters.py[0m
2021-06-03T19:23:06.2598952Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/collections.py[0m
2021-06-03T19:23:06.2600586Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/process.py[0m
2021-06-03T19:23:06.2605110Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/sys_info.py[0m
2021-06-03T19:23:06.2608760Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/text/converters.py[0m
2021-06-03T19:23:06.2610436Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/text/__init__.py[0m
2021-06-03T19:23:06.2615626Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/text/formatters.py[0m
2021-06-03T19:23:06.2618106Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/validation.py[0m
2021-06-03T19:23:06.2619374Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/common/warnings.py[0m
2021-06-03T19:23:06.2620656Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/compat/selectors.py[0m
2021-06-03T19:23:06.2622068Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/compat/__init__.py[0m
2021-06-03T19:23:06.2622803Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/compat/_selectors2.py[0m
2021-06-03T19:23:06.2623483Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/compat/selinux.py[0m
2021-06-03T19:23:06.2624168Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/distro/__init__.py[0m
2021-06-03T19:23:06.2640800Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/distro/_distro.py[0m
2021-06-03T19:23:06.2641785Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/errors.py[0m
2021-06-03T19:23:06.2643125Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/parsing/convert_bool.py[0m
2021-06-03T19:23:06.2645545Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/parsing/__init__.py[0m
2021-06-03T19:23:06.2646602Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/pycompat24.py[0m
2021-06-03T19:23:06.2647204Z 03:51 [0;34mIncluding module_utils file ansible/module_utils/six/__init__.py[0m
2021-06-03T19:23:06.2666142Z 03:51 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpw9g763n1 TO /root/.ansible/tmp/ansible-tmp-1622748186.1474516-19494-19983167396933/async_wrapper.py[0m
2021-06-03T19:23:06.2669400Z 03:51 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.1474516-19494-19983167396933/ /root/.ansible/tmp/ansible-tmp-1622748186.1474516-19494-19983167396933/AnsiballZ_iptables_state.py /root/.ansible/tmp/ansible-tmp-1622748186.1474516-19494-19983167396933/async_wrapper.py && sleep 0'[0m
2021-06-03T19:23:06.2749027Z 03:51 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.1474516-19494-19983167396933/async_wrapper.py 654766443530 10 /root/.ansible/tmp/ansible-tmp-1622748186.1474516-19494-19983167396933/AnsiballZ_iptables_state.py _ && sleep 0'[0m
2021-06-03T19:23:06.4433948Z 03:51 [0;34m<testhost> EXEC /bin/sh -c 'echo ~root && sleep 0'[0m
2021-06-03T19:23:06.4582265Z 03:51 [0;34m<testhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644 `" && echo ansible-tmp-1622748186.4457471-19494-9144138659644="` echo /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644 `" ) && sleep 0'[0m
2021-06-03T19:23:06.4675942Z 03:51 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:06.4677725Z 03:51 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpj1du75qb TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:06.4679635Z 03:51 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpx3iluug2 TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:06.4681167Z 03:51 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:06.4763407Z 03:51 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:06.5056932Z 03:51 [0;34m<testhost> EXEC /bin/sh -c 'touch ~/.ansible_async/iptables.state.starter && sleep 0'[0m
2021-06-03T19:23:06.5132982Z 03:51 [1;35m[WARNING]: Reset is not implemented for this connection[0m
2021-06-03T19:23:07.5151483Z 03:52 [0;34m<testhost> EXEC /bin/sh -c 'rm -f ~/.ansible_async/iptables.state && sleep 0'[0m
2021-06-03T19:23:07.5230412Z 03:52 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:07.5234611Z 03:52 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpadpmoays TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:07.5237997Z 03:52 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpomvlbv61 TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:07.5239876Z 03:52 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:07.5300361Z 03:52 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:08.5530530Z 03:53 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:08.5532306Z 03:53 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpew28_cpy TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:08.5534173Z 03:53 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpopicrsaz TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:08.5540103Z 03:53 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:08.5604210Z 03:53 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:09.5845905Z 03:54 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:09.5847821Z 03:54 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpkgz83qy7 TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:09.5849842Z 03:54 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmp4hafhpzv TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:09.5852352Z 03:54 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:09.5906931Z 03:54 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:10.6132350Z 03:55 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:10.6133417Z 03:55 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpuw64024v TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:10.6134702Z 03:55 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpgbar9gtq TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:10.6139594Z 03:55 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:10.6205672Z 03:55 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:11.6430955Z 03:56 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:11.6432860Z 03:56 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpc3b_l08v TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:11.6435864Z 03:56 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmp1e5b_sdn TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:11.6438025Z 03:56 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:11.6507501Z 03:56 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:12.6735579Z 03:57 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:12.6737514Z 03:57 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpy8zg649q TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:12.6739834Z 03:57 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpufhczfaj TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:12.6741461Z 03:57 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:12.6810544Z 03:57 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:13.7048802Z 03:58 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:13.7050089Z 03:58 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmplykfv4yp TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:13.7051180Z 03:58 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmponcr8mi_ TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:13.7052674Z 03:58 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:13.7114706Z 03:58 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:14.7337845Z 03:59 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:14.7339652Z 03:59 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmp2vb4qox2 TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:14.7341810Z 03:59 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpg0d55719 TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:14.7343628Z 03:59 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:14.7409713Z 03:59 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:15.7637282Z 04:00 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:15.7638708Z 04:00 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpveqit1nt TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:15.7639802Z 04:00 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmp17q3d0kd TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:15.7641316Z 04:00 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:15.7708834Z 04:00 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:16.7938825Z 04:02 [0;34mUsing module file /root/ansible/lib/ansible/modules/async_status.py[0m
2021-06-03T19:23:16.7940203Z 04:02 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpz_1ahnt0 TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py[0m
2021-06-03T19:23:16.7941350Z 04:02 [0;34m<testhost> PUT /root/.ansible/tmp/ansible-local-19158asj5jd4v/tmpph0tudwb TO /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args[0m
2021-06-03T19:23:16.7942743Z 04:02 [0;34m<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/ /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:16.8011437Z 04:02 [0;34m<testhost> EXEC /bin/sh -c 'ANSIBLE_ASYNC_DIR='"'"'~/.ansible_async'"'"' /usr/bin/python3.6 /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/AnsiballZ_async_status.py /root/.ansible/tmp/ansible-tmp-1622748186.4457471-19494-9144138659644/args && sleep 0'[0m
2021-06-03T19:23:16.8281537Z 04:02 [0;31mfatal: [testhost]: FAILED! => {[0m
2021-06-03T19:23:16.8282891Z 04:02 [0;31m    "changed": true,[0m
2021-06-03T19:23:16.8283876Z 04:02 [0;31m    "finished": 0,[0m
2021-06-03T19:23:16.8284433Z 04:02 [0;31m    "module_stderr": "",[0m
2021-06-03T19:23:16.8285037Z 04:02 [0;31m    "module_stdout": "",[0m
2021-06-03T19:23:16.8285688Z 04:02 [0;31m    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",[0m
2021-06-03T19:23:16.8286655Z 04:02 [0;31m    "rc": 0[0m
2021-06-03T19:23:16.8287115Z 04:02 [0;31m}[0m
```

### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/system/iptables_state.py`](https://github.com/ansible-collections/community.general/blob/master/plugins/modules/system/iptables_state.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @quidame
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
According to @bcoca we must not call the async_status *module*, but the async_status *action plugin*. An example how to do that is in the template action plugin: https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/action/template.py#L179-L186
This will get fixed in ansible/ansible's devel branch, with the code of the async_status module getting a deprecation, but we should still switch to using the action plugin because a) it's the correct way to do it since ansible >= 0.4 (according to @bcoca), and b) it will break again once the deprecation expires :)
(https://github.com/ansible/ansible/pull/74908 resurrects the async_status module for now)
!component +=plugins/action/system/iptables_state.py
Files identified in the description:
* [`=plugins/action/system/iptables_state.py`](https://github.com/ansible-collections/community.general/blob/master/=plugins/action/system/iptables_state.py)
* [`plugins/modules/system/iptables_state.py`](https://github.com/ansible-collections/community.general/blob/master/plugins/modules/system/iptables_state.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
!component =plugins/action/system/iptables_state.py
Files identified in the description:
* [`plugins/action/system/iptables_state.py`](https://github.com/ansible-collections/community.general/blob/master/plugins/action/system/iptables_state.py)

If these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->

Resolving patch:
diff --git a/plugins/action/system/iptables_state.py b/plugins/action/system/iptables_state.py
--- a/plugins/action/system/iptables_state.py
+++ b/plugins/action/system/iptables_state.py
@@ -40,18 +40,26 @@ class ActionModule(ActionBase):
         "(=%s) to 0, and 'async' (=%s) to a value >2 and not greater than "
         "'ansible_timeout' (=%s) (recommended).")
 
-    def _async_result(self, module_args, task_vars, timeout):
+    def _async_result(self, async_status_args, task_vars, timeout):
         '''
         Retrieve results of the asynchonous task, and display them in place of
         the async wrapper results (those with the ansible_job_id key).
         '''
+        async_status = self._task.copy()
+        async_status.args = async_status_args
+        async_status.action = 'ansible.builtin.async_status'
+        async_status.async_val = 0
+        async_action = self._shared_loader_obj.action_loader.get(
+            async_status.action, task=async_status, connection=self._connection,
+            play_context=self._play_context, loader=self._loader, templar=self._templar,
+            shared_loader_obj=self._shared_loader_obj)
+
+        if async_status.args['mode'] == 'cleanup':
+            return async_action.run(task_vars=task_vars)
+
         # At least one iteration is required, even if timeout is 0.
         for dummy in range(max(1, timeout)):
-            async_result = self._execute_module(
-                module_name='ansible.builtin.async_status',
-                module_args=module_args,
-                task_vars=task_vars,
-                wrap_async=False)
+            async_result = async_action.run(task_vars=task_vars)
             if async_result.get('finished', 0) == 1:
                 break
             time.sleep(min(1, timeout))
@@ -106,7 +114,7 @@ def run(self, tmp=None, task_vars=None):
                     # longer on the controller); and set a backup file path.
                     module_args['_timeout'] = task_async
                     module_args['_back'] = '%s/iptables.state' % async_dir
-                    async_status_args = dict(_async_dir=async_dir)
+                    async_status_args = dict(mode='status')
                     confirm_cmd = 'rm -f %s' % module_args['_back']
                     starter_cmd = 'touch %s.starter' % module_args['_back']
                     remaining_time = max(task_async, max_timeout)
@@ -168,11 +176,7 @@ def run(self, tmp=None, task_vars=None):
                             del result['invocation']['module_args'][key]
 
                 async_status_args['mode'] = 'cleanup'
-                dummy = self._execute_module(
-                    module_name='ansible.builtin.async_status',
-                    module_args=async_status_args,
-                    task_vars=task_vars,
-                    wrap_async=False)
+                dummy = self._async_result(async_status_args, task_vars, 0)
 
         if not wrap_async:
             # remove a temporary path we created


Test patch: