aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/setup-network/templates
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/setup-network/templates')
-rw-r--r--deploy/adapters/ansible/roles/setup-network/templates/my_configs.debian16
1 files changed, 16 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/setup-network/templates/my_configs.debian b/deploy/adapters/ansible/roles/setup-network/templates/my_configs.debian
new file mode 100644
index 00000000..54031ed4
--- /dev/null
+++ b/deploy/adapters/ansible/roles/setup-network/templates/my_configs.debian
@@ -0,0 +1,16 @@
+{%- for intf in host_ip_settings %}
+
+auto {{ intf["alias"] }}
+iface {{ intf["alias"] }} inet static
+ address {{ intf["ip"] }}
+ netmask {{ intf["netmask"] }}
+{% if "gw" in intf %}
+ gateway {{ intf["gw"] }}
+{% endif %}
+{% for sys_intf in network_cfg["sys_intf_mappings"] %}
+{% if "vlan_tag" in sys_intf and sys_intf["name"] == intf["alias"] %}
+ pre-up ip link set {{ sys_intf["interface"] }} up
+ pre-up ip link add link {{ sys_intf["interface"] }} name {{ sys_intf["name"] }} type vlan id {{ sys_intf["vlan_tag"] }}
+{% endif %}
+{% endfor %}
+{% endfor %}