Last active
July 26, 2021 01:46
-
-
Save chadgeary/c3b65416903e0aa4952256b92c709d1d to your computer and use it in GitHub Desktop.
open-a-port.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo tee /opt/open-a-port.yml << EOM | |
| --- | |
| - name: open-a-port | |
| hosts: localhost | |
| gather_facts: true | |
| become: true | |
| tasks: | |
| - name: iptables accept myservice | |
| iptables: | |
| chain: INPUT | |
| protocol: tcp | |
| destination_port: '9999' | |
| ctstate: 'NEW' | |
| jump: ACCEPT | |
| action: insert | |
| rule_num: '6' | |
| - name: iptables Persistent | |
| shell: | | |
| iptables-save | |
| EOM | |
| sudo ansible-playbook /opt/open-a-port.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment