updated where start is done.
diff --git a/tasks/main.yml b/tasks/main.yml
index be7fa4a..69e320d 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -1,11 +1,22 @@
---
# tasks file for apigee-opdk-iptables-port-block
+#- name: Using iptables to block a port
+# become: true
+# shell: "iptables -A INPUT -p tcp --destination-port {{ destination_port }} ! -s `hostname` -i eth0 -j DROP"
+# environment:
+# http_proxy: "{{ http_proxy }}"
+# https_proxy: "{{ https_proxy }}"
+# no_proxy: "{{ no_proxy }}"
+# PORT_TIMEOUT: '{{ port_timeout | default(60) }}'
+# UP_TIMEOUT: '{{ up_timeout | default(60) }}'
+
- name: Using iptables to block a port
become: true
- shell: "iptables -A INPUT -p tcp --destination-port {{ destination_port }} ! -s `hostname` -i eth0 -j DROP"
- environment:
- http_proxy: "{{ http_proxy }}"
- https_proxy: "{{ https_proxy }}"
- no_proxy: "{{ no_proxy }}"
- PORT_TIMEOUT: '{{ port_timeout | default(60) }}'
- UP_TIMEOUT: '{{ up_timeout | default(60) }}'
+ iptables:
+ action: append
+ chain: INPUT
+ protocol: tcp
+ destination_port: "{{ destination_port }}"
+ source: "{{ inventory_hostname }}"
+ in_interface: eth0
+ policy: DROP