aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/setup-network/templates
diff options
context:
space:
mode:
authoryour name <email@163.com>2015-09-09 03:26:11 -0400
committeryour name <email@163.com>2015-09-09 03:26:11 -0400
commit72039e915d1fc960bd0d7fccd910ea282d61bee7 (patch)
tree60452129b1b9f3c3419b4a29a038f5f0cbade5f7 /deploy/adapters/ansible/roles/setup-network/templates
parentcf87d3067a63cb8be315a3addfd9c27d86be3b5a (diff)
Compass Netconfig optimization
Change-Id: Icbcfc7d794623436f22be5f6763b212a25d4fac7 JIRA: COMPASS-30
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 %}