From a6ec8f8947e1d6e56d1c0af6b67af2e7468ef98f Mon Sep 17 00:00:00 2001 From: heqnx Date: Sun, 22 Jun 2025 20:19:31 +0300 Subject: initial commit on working deployment --- templates/hosts.j2 | 7 +++++++ templates/interfaces.j2 | 23 +++++++++++++++++++++++ templates/rules.v4.j2 | 13 +++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 templates/hosts.j2 create mode 100644 templates/interfaces.j2 create mode 100644 templates/rules.v4.j2 (limited to 'templates') diff --git a/templates/hosts.j2 b/templates/hosts.j2 new file mode 100644 index 0000000..3d811dc --- /dev/null +++ b/templates/hosts.j2 @@ -0,0 +1,7 @@ +127.0.0.1 localhost +{{ ansible_host }} {{ hostname }} {{ hostname }} + +# The following lines are desirable for IPv6 capable hosts +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters diff --git a/templates/interfaces.j2 b/templates/interfaces.j2 new file mode 100644 index 0000000..7813093 --- /dev/null +++ b/templates/interfaces.j2 @@ -0,0 +1,23 @@ +auto lo +iface lo inet loopback + +auto {{ public_interface }} +iface {{ public_interface }} inet manual + +auto vmbr0 +iface vmbr0 inet static + address {{ ansible_host }} + netmask 255.255.255.0 + gateway {{ public_gateway }} + bridge_ports {{ public_interface }} + bridge_stp off + bridge_fd 0 + +auto vmbr1 +iface vmbr1 inet static + address {{ nat_bridge_ip }} + netmask 255.255.255.0 + bridge_ports none + bridge_stp off + bridge_fd 0 + diff --git a/templates/rules.v4.j2 b/templates/rules.v4.j2 new file mode 100644 index 0000000..6a0e54f --- /dev/null +++ b/templates/rules.v4.j2 @@ -0,0 +1,13 @@ +*filter +:INPUT ACCEPT [0:0] +:FORWARD ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +COMMIT + +*nat +:PREROUTING ACCEPT [0:0] +:INPUT ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +:POSTROUTING ACCEPT [0:0] +-A POSTROUTING -s {{ nat_subnet }} -o {{ public_interface }} -j MASQUERADE +COMMIT -- cgit v1.2.3