Skip to content

Commit

Permalink
rundall/ncsa/svcplan-4943: (#58)
Browse files Browse the repository at this point in the history
Allow slurmdbd_storage_port to be an empty string ("" or ''), which supports
slurmdbd connecting to the DB via a socket rather than via TCP/IP.

Adjust the template for slurmdbd.conf so that if any value is an empty string (''),
then put "" in as the value for StoragePort.
  • Loading branch information
jakerundall authored Apr 16, 2024
1 parent 1b1efc8 commit 11ac47a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ Default value: `'slurmdbd'`

##### <a name="-slurm--slurmdbd_storage_port"></a>`slurmdbd_storage_port`

Data type: `Stdlib::Port`
Data type: `Variant[Stdlib::Port, String[0,0]]`



Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
Stdlib::Host $slurmdbd_storage_host = 'localhost',
String[1] $slurmdbd_storage_loc = 'slurm_acct_db',
String[1] $slurmdbd_storage_pass = 'slurmdbd',
Stdlib::Port $slurmdbd_storage_port = 3306,
Variant[Stdlib::Port, String[0,0]] $slurmdbd_storage_port = 3306,
String[1] $slurmdbd_storage_type = 'accounting_storage/mysql',
String[1] $slurmdbd_storage_user = 'slurmdbd',
String[1] $slurmdbd_db_charset = 'utf8',
Expand Down
8 changes: 8 additions & 0 deletions spec/shared_examples/slurm_slurmdbd_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@
end
end

context 'when slurmdbd_storage_port => ""' do
let(:param_override) { { slurmdbd_storage_port: '' } }

it 'overrides values' do
verify_contents(catalogue, 'slurmdbd.conf', ['StoragePort=""'])
end
end

context 'when use_syslog => true' do
let(:param_override) { { use_syslog: true } }

Expand Down
2 changes: 2 additions & 0 deletions templates/slurmdbd/slurmdbd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# <%= key %>
<%- elsif value.is_a?(Array) -%>
<%= key %>=<%= value.join(',') %>
<%- elsif value == '' -%>
<%= key %>=""
<%- elsif value.is_a?(Hash) -%>
<%- v = value.map {|k,v| "#{k}=#{v}" }.join(',') %>
<%= key %>=<%= v %>
Expand Down

0 comments on commit 11ac47a

Please sign in to comment.