From 07623cfffae1bb52ed7a6822a1053db6aa897a0a Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Fri, 18 Mar 2016 20:36:52 +0000 Subject: [PATCH] and put in items for the rules --- inventory/group_vars/download-phx2 | 3 ++- roles/base/templates/iptables/iptables.download-phx2 | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/inventory/group_vars/download-phx2 b/inventory/group_vars/download-phx2 index e44d0e0ab5..16bcc2dfb0 100644 --- a/inventory/group_vars/download-phx2 +++ b/inventory/group_vars/download-phx2 @@ -8,4 +8,5 @@ nrpe_procs_crit: 1000 # nfs mount options, overrides the all/default nfs_mount_opts: "ro,hard,bg,intr,noatime,nodev,nosuid,actimeo=600,nfsvers=3" -custom_rules: [ '-A INPUT -s 143.106.60.118 -j DROP', '-A INPUT -s 143.106.60.112 -j DROP', '-A INPUT -s 169.53.165.245 -j DROP', '-A INPUT -s 46.29.92.6 -j DROP', '-A INPUT -s 198.11.167.9 -j DROP', '-A INPUT -s 103.193.116.147 -j DROP', '-A INPUT -s 69.47.68.211 -j DROP' ] +blocked_ips: ['143.106.60.118', '143.106.60.112', '169.53.165.245', '46.29.92.6', '198.11.167.9', '103.193.116.147', '69.47.68.211'] + diff --git a/roles/base/templates/iptables/iptables.download-phx2 b/roles/base/templates/iptables/iptables.download-phx2 index e876c5361b..9047ba1af1 100644 --- a/roles/base/templates/iptables/iptables.download-phx2 +++ b/roles/base/templates/iptables/iptables.download-phx2 @@ -80,9 +80,9 @@ {% endfor %} {% endif %} -# if the block_hosts is defined - drop them -{% if block_hosts is defined %} -{% for ip in block_hosts %} +# if the blocked_ips is defined - drop them +{% if blocked_ips is defined %} +{% for ip in blocked_ips %} -A INPUT -s {{ ip }} -j DROP {% endfor %} {% endif %}