Ansible - iptables_state module

If you are not familiar with modules, check out Ansible - Getting Started with Modules.

The iptables_state module is used to save changes made to iptables. The iptables_state module is part of the community.general collection, thus you may need to use the ansible-galaxy install command to install the community.general collection.

#]$ ansible-galaxy collection install community.general
Process install dependency map
Starting collection install process
Installing 'community.general:4.0.2' to '/home/john.doe/.ansible/collections/ansible_collections/community/general'


In this example, iptables will be saved to the /etc/sysconfig/iptables file.

- name: save iptables
    state: saved
    path: /etc/sysconfig/iptables


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 4ba1d in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |