treydock / puppet-slurm

Other
2 stars 12 forks source link

would like to be able to set slurmdbd_storage_port to "" instead of an actual port number #57

Open jakerundall opened 6 months ago

jakerundall commented 6 months ago

We often configure MariaDB to not listen via TCP/IP and instead to only accept socket connections. And then we set StoragePort="" in slurmdbd.conf and slurmdbd will connect via socket.

Can we update the type for slurmdbd_storage_port as follows to accept an empty string as a valid value?

Variant[Stdlib::Port, Enum['""']]

I've forked and created a branch here: https://github.com/jakerundall/puppet-slurm/tree/rundall/ncsa/svcplan-4943

If you'd like I can submit a PR.

Thanks!

treydock commented 6 months ago

I'd recommend instead do

Variant[Stdlib::Port, String[0,0]]

To allow either a port of empty string.

jakerundall commented 6 months ago

I should have described it better — it needs to accept a string that contains "", not an actual empty string. Because we need Puppet to put the following in slurmdbd.conf (set the param as an empty string surrounded by ""):

StoragePort=""

If we only allow an actual string, then Puppet tries to put in the following (param w/o value):

StoragePort=

But then slurmdbd won't start:

[root@mgsched2 ~]# slurmdbd -D -vvvvv
slurmdbd: error: Parse error in file /etc/slurm/slurmdbd.conf line 50: "StoragePort="
slurmdbd: fatal: Could not open/read/parse slurmdbd.conf file /etc/slurm/slurmdbd.conf
treydock commented 6 months ago

Ah, so in that case that might mean to update the template. So if you set empty string, ie String[0,0] then something like this in template:

<%- elsif value == '' -%>
<%= key %>=""

Here:

https://github.com/treydock/puppet-slurm/blob/8092040ef0280d38342e6ce47661ae1efe6ee1e0/templates/slurmdbd/slurmdbd.conf.erb#L16-L19

jakerundall commented 6 months ago

Yep, that does also work, and it's definitely cleaner in terms of usage and documentation.

https://github.com/treydock/puppet-slurm/compare/master...jakerundall:puppet-slurm:rundall/ncsa/svcplan-4943