aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-06-22 20:19:31 +0300
committerheqnx <root@heqnx.com>2025-06-22 20:19:31 +0300
commita6ec8f8947e1d6e56d1c0af6b67af2e7468ef98f (patch)
tree9648fbb43104e577379374088c9e6975d06dbc6b /templates
parent64a84a53c783665b7ff1aa20e4cb370001fb8162 (diff)
downloadansible-pve-host-a6ec8f8947e1d6e56d1c0af6b67af2e7468ef98f.tar.gz
ansible-pve-host-a6ec8f8947e1d6e56d1c0af6b67af2e7468ef98f.zip
initial commit on working deployment
Diffstat (limited to 'templates')
-rw-r--r--templates/hosts.j27
-rw-r--r--templates/interfaces.j223
-rw-r--r--templates/rules.v4.j213
3 files changed, 43 insertions, 0 deletions
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