summaryrefslogtreecommitdiffstats
path: root/config/installers/fuel/net_macros.j2
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-06-04 16:53:26 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-06-04 16:53:26 +0000
commit753797d22d437296ee6f4355ec088e69817e2b46 (patch)
tree571edd10603295e92184afe3067a51b967969b6e /config/installers/fuel/net_macros.j2
parent70f8d63761a0d52790f634642785c9e8bc0d7419 (diff)
parentc38832004b18c120c796dcfff6e333d60392bc9c (diff)
Merge "[fuel] IA: Add PXE/admin static IPs"
Diffstat (limited to 'config/installers/fuel/net_macros.j2')
-rw-r--r--config/installers/fuel/net_macros.j236
1 files changed, 36 insertions, 0 deletions
diff --git a/config/installers/fuel/net_macros.j2 b/config/installers/fuel/net_macros.j2
new file mode 100644
index 00000000..b9693d11
--- /dev/null
+++ b/config/installers/fuel/net_macros.j2
@@ -0,0 +1,36 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+{%- macro linux_network_interfaces_nic(nics) -%}
+{%- for nic in nics %}
+ {{ nic }}:
+ enabled: true
+ type: eth
+ proto: manual
+ mtu: ${_param:interface_mtu}
+ name: {{ nic }}
+ noifupdown: true
+{%- endfor %}
+{%- endmacro -%}
+
+{%- macro linux_network_interfaces_vlan(vlans) -%}
+{%- for vlan in vlans %}
+ {%- if vlan | int > 0 %}
+ {{ vlans[vlan] }}.{{ vlan }}:
+ enabled: true
+ proto: manual
+ type: vlan
+ name: {{ vlans[vlan] }}.{{ vlan }}
+ use_interfaces:
+ - {{ vlans[vlan] }}
+ {%- endif %}
+{%- endfor %}
+{%- endmacro -%}
+
+{%- macro interface_str(nic, vlan = 0) -%}
+ {{ nic }}{% if vlan | int > 0 %}.{{ vlan }}{% endif %}
+{%- endmacro -%}