{%- endfor %}
{%- for vlan in vlans %}
- {%- if vlan and vlan != 'native' %}
+ {%- if vlan | int > 0 %}
{{ vlans[vlan] }}.{{ vlan }}:
enabled: true
proto: manual
proto: dhcp
type: bridge
use_interfaces:
- - {{ nm.ctl01.nic_admin }}{% if nm.vlan_admin and nm.vlan_admin != 'native' %}.{{ nm.vlan_admin }}{% endif %}
+ - {{ nm.ctl01.nic_admin }}{% if nm.vlan_admin | int > 0 %}.{{ nm.vlan_admin }}{% endif %}
noifupdown: true
br-ctl:
enabled: true
address: ${_param:single_address}
netmask: 255.255.255.0
use_interfaces:
- - {{ nm.ctl01.nic_mgmt }}{% if nm.vlan_mgmt and nm.vlan_mgmt != 'native' %}.{{ nm.vlan_mgmt }}{% endif %}
+ - {{ nm.ctl01.nic_mgmt }}{% if nm.vlan_mgmt | int > 0 %}.{{ nm.vlan_mgmt }}{% endif %}
noifupdown: true
br-ex:
enabled: true
netmask: ${_param:opnfv_net_public_mask}
type: bridge
use_interfaces:
- - {{ nm.ctl01.nic_public }}{% if nm.vlan_public and nm.vlan_public != 'native' %}.{{ nm.vlan_public }}{% endif %}
+ - {{ nm.ctl01.nic_public }}{% if nm.vlan_public | int > 0 %}.{{ nm.vlan_public }}{% endif %}
noifupdown: true
{%- endfor %}
{%- for vlan in vlans %}
- {%- if vlan and vlan != 'native' %}
+ {%- if vlan | int > 0 %}
{{ vlans[vlan] }}.{{ vlan }}:
enabled: true
proto: manual
address: ${_param:single_address}
netmask: 255.255.255.0
use_interfaces:
- - {{ nm.cmp001.nic_mgmt }}{% if nm.vlan_mgmt and nm.vlan_mgmt != 'native' %}.{{ nm.vlan_mgmt }}{% endif %}
+ - {{ nm.cmp001.nic_mgmt }}{% if nm.vlan_mgmt | int > 0 %}.{{ nm.vlan_mgmt }}{% endif %}
br-floating:
enabled: true
type: ovs_bridge
gateway: ${_param:opnfv_net_public_gw}
ovs_port_{{ nm.cmp001.nic_public }}:
enabled: true
- name: {{ nm.cmp001.nic_public }}{% if nm.vlan_public and nm.vlan_public != 'native' %}.{{ nm.vlan_public }}{% endif %}
+ name: {{ nm.cmp001.nic_public }}{% if nm.vlan_public | int > 0 %}.{{ nm.vlan_public }}{% endif %}
proto: manual
ovs_port_type: OVSPort
type: ovs_port
#!/bin/bash -e
-# shellcheck disable=SC2155,SC1001,SC2015
+# shellcheck disable=SC2155,SC1001,SC2015,SC2128
##############################################################################
# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
# All rights reserved. This program and the accompanying materials
}
function jumpserver_check_requirements {
+ # shellcheck disable=SC2178
local vnodes=$1; shift
local br=("$@")
local err_br_not_found='Linux bridge not found!'
RECLASS_CLUSTER_DIR=$(cd "${git_repo_root}/mcp/reclass/classes/cluster"; pwd)
PHAROS_GEN_CFG="./pharos/config/utils/generate_config.py"
- PHAROS_INSTALLER_ADAPTER="./pharos/config/installers/fuel/pod_config.yml.j2"
- PHAROS_INSTALLER_NETMAP="$(dirname "${PHAROS_INSTALLER_ADAPTER}")/net_map.j2"
+ PHAROS_IA=$(readlink -f "./pharos/config/installers/fuel/pod_config.yml.j2")
PHAROS_VALIDATE_SCHEMA_SCRIPT="./pharos/config/utils/validate_schema.py"
PHAROS_SCHEMA_PDF="./pharos/config/pdf/pod1.schema.yaml"
PHAROS_SCHEMA_IDF="./pharos/config/pdf/idf-pod1.schema.yaml"
if [[ ! "$target_pod" =~ "virtual" ]]; then
if ! "${PHAROS_VALIDATE_SCHEMA_SCRIPT}" -y "${LOCAL_PDF}" \
-s "${PHAROS_SCHEMA_PDF}"; then
- notify_e "[ERROR] PDF does not match yaml schema!\n" 1>&2
+ notify_e "[ERROR] PDF does not match yaml schema!"
elif ! "${PHAROS_VALIDATE_SCHEMA_SCRIPT}" -y "${LOCAL_IDF}" \
-s "${PHAROS_SCHEMA_IDF}"; then
- notify_e "[ERROR] IDF does not match yaml schema!\n" 1>&2
+ notify_e "[ERROR] IDF does not match yaml schema!"
fi
fi
if ! "${PHAROS_GEN_CFG}" -y "${LOCAL_PDF}" \
- -j "${PHAROS_INSTALLER_ADAPTER}" > "${image_dir}/pod_config.yml"; then
+ -j "${PHAROS_IA}" -v > "${image_dir}/pod_config.yml"; then
notify_e "[ERROR] Could not convert PDF+IDF to reclass model input!"
fi
template_dirs="${scenario_dir}"
# Expand reclass and virsh network templates based on PDF + IDF
printenv | \
awk '/^(SALT|MCP|MAAS|CLUSTER).*=/ { gsub(/=/,": "); print }' >> "${LOCAL_PDF}"
- template_dirs="${RECLASS_CLUSTER_DIR} virsh_net ./*j2"
+ template_dirs="${RECLASS_CLUSTER_DIR} $(readlink -f virsh_net) $(readlink -f ./*j2)"
template_err_str='Could not convert PDF to network definitions!'
fi
# shellcheck disable=SC2086
- find ${template_dirs} -name '*.j2' | while read -r tp; do
- # Jinja2 import does not allow '..' directory traversal
- ln -sf "$(readlink -f "${PHAROS_INSTALLER_NETMAP}")" "$(dirname "${tp}")"
- if ! "${PHAROS_GEN_CFG}" -y "${LOCAL_PDF}" -j "${tp}" > "${tp%.j2}"; then
- notify_e "[ERROR] ${template_err_str}"
- fi
- rm -f "$(dirname "${tp}")/$(basename "${PHAROS_INSTALLER_NETMAP}")"
- done
+ j2args=$(find $template_dirs -name '*.j2' -exec echo -j {} \;)
+ # shellcheck disable=SC2086
+ if ! "${PHAROS_GEN_CFG}" -y "${LOCAL_PDF}" ${j2args} -b -v \
+ -i "$(dirname "${PHAROS_IA}")"; then
+ notify_e "[ERROR] ${template_err_str}"
+ fi
}