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)
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()
usingdict.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
andresources.yaml
, considering they all share the same code)