Created
July 26, 2021 01:50
-
-
Save chadgeary/0a70ed10c914a9c98ce06b66e0b6c63d to your computer and use it in GitHub Desktop.
open-to-container.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-to-container.yml << EOM | |
| --- | |
| - name: open-to-container | |
| hosts: localhost | |
| gather_facts: true | |
| become: true | |
| tasks: | |
| - name: iptables accept myservice | |
| iptables: | |
| chain: DOCKER | |
| protocol: tcp | |
| destination_port: '9999' | |
| ctstate: 'NEW' | |
| jump: ACCEPT | |
| action: insert | |
| rule_num: '5' | |
| - name: iptables Persistent | |
| shell: | | |
| iptables-save | |
| EOM | |
| sudo ansible-playbook /opt/open-to-container.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment