reclass.storage.node: Merge duplicate nodes

Reclass does not support duplicate nodes in top pillar, so merge all
nodes with the same name into a single node, inheriting classes from
all instances.

This allows using multiple "system.reclass.storage.system.*_cluster"
classes for the same node, based on re-using the name (hostname); by
simply overriding the hostname parameters, e.g.:
  openstack_gateway_node01_hostname: ctl01

NOTE: defaults.merge module does not merge lists (e.g. for classes),
so handle that case separately. Also, leave repeated nodes alone.

Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 files changed