summaryrefslogtreecommitdiffstats
path: root/config/installers/fuel/net_macros.j2
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-04-07 10:58:08 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-06-04 14:36:32 +0200
commitc38832004b18c120c796dcfff6e333d60392bc9c (patch)
tree2c4f452e2c521140ecc412ffb09b3fe91eb4d6bf /config/installers/fuel/net_macros.j2
parent56eec7f0a4e379c975bc9c6d57905c24c590fe9a (diff)
[fuel] IA: Add PXE/admin static IPs
- check-jinja2.sh: Add template dir to include dirs; - add param definitions for PXE/admin static IP for each machine, moving MaaS DHCP range start after the new addresses, similar to public network; - drop 'opnfv_' prefix for compute parameters; - drop 'opnfv_jump_bridge_*' variables (deprecated); - drop 'opnfv_infra_maas_*' variables, handled directly in Fuel now; - add 'opnfv_net_*_mask' for all used networks in idf.net_config; - move all internal j2 variables to net_map.j2, so we can reuse them without pod_config; - refactor maas variables into a full `maas.region.machines` section when baremetal nodes are defined; - drop 'openstack_compute_*' reclass params in favor of direct expansion in reclass.storage definitions via j2 in Fuel@OPNFV; - add `net_macros.j2` for reclass linux.network reclass generation; - move all non-sensitive reclass parameters to Fuel@OPNFV; Change-Id: I495c6072d845b273b6607d45dc5152ec4ee767cf Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
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 -%}