I need to enter a block of data on a remote host using ansible, i have tried "blockinfile" but was unsuccessful..
But when i run the same thing on omy local hosts it works fine dont know why
---
- hosts: 1.1.0.1
tasks:
- name: putting /tmp/fire.txt File on all machine.
blockinfile:
dest: /tmp/fire.txt
Block: |
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp --tcp-flags ALL NONE -j DROP
-A INPUT -p tcp ! --syn -m state --state NEW -j DROP
-A INPUT -p tcp --tcp-flags ALL ALL -j DROP
-A INPUT -p udp --sport 53 -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -p tcp --dport 23 -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 3260 -j ACCEPT --comment "Enable iscsi port"
-A INPUT -p tcp --dport 119 -j ACCEPT --comment "Enable nfs TCP port"
-A INPUT -p tcp --dport 2049 -j ACCEPT --comment "Enable nfs UDP port"
COMMIT