Allow to set address-related parameters in interface arguments
There is a fixed list of allowed parameters that can be set
as interface parameters to override the values from cluster model.
List of allowed parameters can be found in the file:
{# roles #}/_linux_network_interface
Example for single_address, control_network_netmask and control_vlan:
kvm01.mcp11-ovs-dpdk.local:
reclass_storage_name: infra_kvm_node01
roles:
- infra_kvm
- linux_system_codename_xenial
interfaces:
ens3:
role: single_dhcp
ens4:
role: single_vlan_ctl
single_address: 1.2.3.4
control_network_netmask: 255.255.252.0
control_vlan: 1234
Change-Id: I52f1250a3af510275d7741a1717a04be348778b8
diff --git "a/\173\173 cookiecutter._env_name \175\175/init.yml" "b/\173\173 cookiecutter._env_name \175\175/init.yml"
index 89db66f..f803888 100644
--- "a/\173\173 cookiecutter._env_name \175\175/init.yml"
+++ "b/\173\173 cookiecutter._env_name \175\175/init.yml"
@@ -12,24 +12,25 @@
node:
{%- for inventory_node_name, node in nodes.items()|sort %}
{%- set node_name = inventory_node_name.split('.')[0] %}
- {{ node['reclass_storage_name'] }}:
+ {{ node['reclass_storage_name'] }}:
+ {#-#}
{#- 'local_metadata' is to collect the data from different roles in a single place inside the node #}
{%- set local_metadata = {} %}
{#- 'params' dict object is dynamically generated from 'roles' to add on the node #}
{%- set params = {} %}
-
+ {#-#}
{%- macro register_metaparam(param_name, role_name) %}
{#- Add the <role_name> into the list attached to <param_name> #}
{#- to control that the <param_name> is not spreaded across incompatible roles #}
{%- set _ = local_metadata.update({param_name: local_metadata.get(param_name, []) + [role_name]}) %}
{%- endmacro %}
-
+ {#-#}
{%- macro set_param(param_name, param_value) %}
{#- Set a parameter for '_param' dict for the node #}
{%- set _ = params.update({param_name: param_value}) %}
{%- endmacro %}
-
+ {#-#}
classes:
{#- Default roles are added to each node #}
{#- 'overrides' must be the very last role for each node #}