stackhpc / ansible-role-openhpc

Ansible role for OpenHPC
Apache License 2.0
45 stars 15 forks source link

Make slurm.conf more flexible #108

Closed sjpb closed 2 years ago

sjpb commented 3 years ago

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 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.

sjpb commented 3 years ago

Now using this for alaska.

sjpb commented 2 years ago

Closing to try to get tests running again