aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/network/templates/nomad-interface.j2
diff options
context:
space:
mode:
authorQuentin <quentin@deuxfleurs.fr>2019-06-01 16:02:49 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2019-07-11 09:33:07 +0200
commit61d009f18d5886db8b22ae41e04bb41a4ba2fddb (patch)
treee44bb326caf3107653c7a48749527cfd77f02cf2 /ansible/roles/network/templates/nomad-interface.j2
downloadinfrastructure-61d009f18d5886db8b22ae41e04bb41a4ba2fddb.tar.gz
infrastructure-61d009f18d5886db8b22ae41e04bb41a4ba2fddb.zip
Initial commit
Diffstat (limited to 'ansible/roles/network/templates/nomad-interface.j2')
-rw-r--r--ansible/roles/network/templates/nomad-interface.j28
1 files changed, 8 insertions, 0 deletions
diff --git a/ansible/roles/network/templates/nomad-interface.j2 b/ansible/roles/network/templates/nomad-interface.j2
new file mode 100644
index 0000000..74e9cd4
--- /dev/null
+++ b/ansible/roles/network/templates/nomad-interface.j2
@@ -0,0 +1,8 @@
+auto nomad1
+iface nomad1 inet manual
+ pre-up /sbin/ip link add nomad1 type dummy
+ up /sbin/ip addr add {{ public_ip }} dev nomad1
+ up /sbin/iptables -t nat -A PREROUTING -d {{ private_ip }}/32 -j NETMAP --to {{ public_ip }}/32
+ down /sbin/iptables -t nat -D PREROUTING -d {{ private_ip }}/32 -j NETMAP --to {{ public_ip }}/32
+ post-down /sbin/ip link del nomad1
+