Adds a role var openhpc_extra_config which is a mapping of extra parameters for slurm.conf. These can be in addition to, or override those included in the slurm.conf.j2 template (either hard-coded or interpolated). Uses the ini_file module as this works nicely with comments, including changing commented-out parameters into un-commented parameters etc. as necessary.
I tried using the merge_configs action plugin but a) it deletes comments and b) it didn't handle the node templating correctly, resulting in an unreadable config - for the latter I think it needs to support lstrip_blocks from the template module but it was not at all obvious how to pass this through. The current approach's interface of the mapping of parameters seems preferable to the list-of-partial files IMO as well.
As the ini_file module can only modify a file in-place a local temporary file is used.
Fixes #21.
Adds a role var
openhpc_extra_config
which is a mapping of extra parameters for slurm.conf. These can be in addition to, or override those included in theslurm.conf.j2
template (either hard-coded or interpolated). Uses theini_file
module as this works nicely with comments, including changing commented-out parameters into un-commented parameters etc. as necessary.I tried using the merge_configs action plugin but a) it deletes comments and b) it didn't handle the node templating correctly, resulting in an unreadable config - for the latter I think it needs to support
lstrip_blocks
from the template module but it was not at all obvious how to pass this through. The current approach's interface of the mapping of parameters seems preferable to the list-of-partial files IMO as well.As the
ini_file
module can only modify a file in-place a local temporary file is used.