stackhpc / ansible-role-openhpc

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

Unable to add extra slurm.conf items with the same key #169

Open tom91136 opened 3 weeks ago

tom91136 commented 3 weeks ago

We're using this playbook to setup a Warewulf managed system so the compute nodes will not be available (images are not created yet so can't boot). The current play tolerates empty host groups but we can't inject computes nodes with known configurations because openhpc_config expects a dictionary:

      openhpc_config:
        NodeName: "compute1 CPU=1 State=UNKNOWN"
        NodeName: "compute0 CPU=1 State=UNKNOWN" # duplicate key

Looking at the slurm.conf syntax, I think using a list will be more appropriate here.

tom91136 commented 3 weeks ago

For backwards compatibility, we can check if openhpc_config is a string or list and append the content (one line per list item or the entire string as-is) at the end of the slurm.conf template for maximum flexibility.

tom91136 commented 3 weeks ago

Happy to open a PR if welcomed.