summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2016-04-20 15:05:03 -0500
committerAndy Doan <andy.doan@linaro.org>2016-04-20 15:06:14 -0500
commitfdb0f63842ebd25c480080227cc4bb38ac6f301a (patch)
treedc039983e2a02fc2b9ae98d2b1a51ae9aef8708f
parentdd45d54ab74c265513805d309041235c167114fe (diff)
colo: stop managing iptables.conf
This file is now managed dynamically with tools like devcloud-admin. Additionally, we want to allow inline comments. Change-Id: I5db28e940e2c01b5e2a459e2eb6a608171eb6f74
-rw-r--r--roles/colo-router/files/iptables.conf91
-rwxr-xr-xroles/colo-router/files/manage_iptables.py3
-rw-r--r--roles/colo-router/tasks/main.yml7
3 files changed, 2 insertions, 99 deletions
diff --git a/roles/colo-router/files/iptables.conf b/roles/colo-router/files/iptables.conf
deleted file mode 100644
index 8c4827ed..00000000
--- a/roles/colo-router/files/iptables.conf
+++ /dev/null
@@ -1,91 +0,0 @@
-[public/private mappings]
-# r1-a1
-64.28.108.83 = 10.64.0.101
-# r1-a2
-64.28.108.84 = 10.64.0.102
-# r1-a3
-64.28.108.85 = 10.64.0.103
-
-# r1-a21 (weechat.linaro.org)
-64.28.108.189 = 10.10.0.121
-
-# developer cloud ips
-# odpi
-64.28.99.27 = 10.33.10.100
-64.28.99.28 = 10.33.10.101
-
-# ganesh testing
-64.28.99.29 = 10.33.10.23
-
-# davidm testing
-64.28.99.30 = 10.33.10.106
-
-#64.28.99.31
-#64.28.99.32
-#64.28.99.33
-#64.28.99.34
-
-#64.28.99.40
-#64.28.99.41
-#64.28.99.42
-#64.28.99.43
-#64.28.99.44
-#64.28.99.45
-#64.28.99.46
-#64.28.99.47
-#64.28.99.48
-#64.28.99.49
-#64.28.99.50
-#64.28.99.51
-#64.28.99.52
-#64.28.99.53
-#64.28.99.54
-#64.28.99.55
-#64.28.99.56
-#64.28.99.57
-#64.28.99.58
-#64.28.99.59
-#64.28.99.60
-#64.28.99.61
-#64.28.99.62
-#64.28.99.63
-#64.28.99.64
-#64.28.99.65
-#64.28.99.66
-#64.28.99.67
-#64.28.99.68
-#64.28.99.69
-#64.28.99.70
-#64.28.99.71
-#64.28.99.72
-#64.28.99.73
-#64.28.99.74
-#64.28.99.75
-#64.28.99.76
-#64.28.99.77
-#64.28.99.78
-#64.28.99.79
-#64.28.99.80
-#64.28.99.81
-#64.28.99.82
-#64.28.99.83
-#64.28.99.84
-#64.28.99.85
-#64.28.99.86
-#64.28.99.87
-#64.28.99.88
-#64.28.99.89
-#64.28.99.90
-#64.28.99.91
-#64.28.99.92
-#64.28.99.93
-#64.28.99.94
-#64.28.99.95
-#64.28.99.96
-#64.28.99.97
-#64.28.99.98
-#64.28.99.99
-#64.28.99.100
-#64.28.99.101
-#64.28.99.102
-#64.28.99.103
diff --git a/roles/colo-router/files/manage_iptables.py b/roles/colo-router/files/manage_iptables.py
index ffa9b68e..e31f3276 100755
--- a/roles/colo-router/files/manage_iptables.py
+++ b/roles/colo-router/files/manage_iptables.py
@@ -87,7 +87,8 @@ def _sync(args):
cp = configparser.ConfigParser()
cp.read(args.file)
config = cp['public/private mappings']
- pub_to_priv = set(config.items())
+ pub_to_priv = [(x, y.split('#')[0].strip()) for x, y in config.items()]
+ pub_to_priv = set([(x, y) for x, y in pub_to_priv if y])
inchain, outchain = _get_in_out_chains()
_sync_inbound(inchain, pub_to_priv)
diff --git a/roles/colo-router/tasks/main.yml b/roles/colo-router/tasks/main.yml
index 4984b528..b3f1d951 100644
--- a/roles/colo-router/tasks/main.yml
+++ b/roles/colo-router/tasks/main.yml
@@ -68,13 +68,6 @@
- name: Copy manage_iptables.py
copy: src=manage_iptables.py dest=/usr/local/bin/manage_iptables.py mode=0655
-- name: Copy iptables.conf
- copy: src=iptables.conf dest=/etc/iptables.conf mode=0655
- tags:
- - dns
- notify:
- - reload iptables
-
- name: Set up network interfaces
copy: src=router-interfaces
dest=/etc/network/interfaces