cea-hpc / pcocc

Run VMs on an HPC cluster
GNU General Public License v3.0
47 stars 14 forks source link

Split templates.yaml into separated files in 'templates' directory #2

Closed degremont closed 6 years ago

degremont commented 6 years ago

Instead of having one unique templates.yaml file where templates could be declared (globally in /etc/pcocc/templates.yaml or per-user ~/.pcocc/templates.yaml) it could be much convenient to use a directory where this file could be splitted into an unlimited number of files.

This would help template management, administration and template shipping.

It makes sense to support this for the global and per-user definitions.

From a coding stand point, it is simple to iterate over each file and merge all dicts returned by yaml.safe_load() using dict.update() method. Doing so you still have a unique dict to analyze like now.

(Even if I do not personally need it, it makes sense to support this for networks.yaml and resources.yaml, considering they all share the same code)