diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 795fac70..435d9ee4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,11 +16,11 @@ jobs: fail-fast: false matrix: include: - - ruby: 2.7.7 + - ruby: 2.7.8 puppet: 7 fixtures: .fixtures.yml allow_failure: false - - ruby: 3.2.2 + - ruby: 3.2.3 puppet: 8 fixtures: .fixtures.yml allow_failure: false @@ -56,10 +56,13 @@ jobs: puppet: - "puppet7" - "puppet8" + slurm_version: + - "23.11.10" + - "24.05.4" env: BUNDLE_WITHOUT: development:release BEAKER_debug: true - name: ${{ matrix.puppet }} ${{ matrix.set }} + name: ${{ matrix.puppet }} ${{ matrix.set }} (slurm=${{ matrix.slurm_version }}) steps: - name: Enable IPv6 on docker run: | @@ -86,3 +89,4 @@ jobs: env: BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet }} BEAKER_set: ${{ matrix.set }} + BEAKER_slurm_version: ${{ matrix.slurm_version }} diff --git a/.rubocop.yml b/.rubocop.yml index 22075399..7ed5f8e0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -59,7 +59,15 @@ Style/TernaryParentheses: Style/TrailingCommaInArguments: Description: Prefer always trailing comma on multiline argument lists. This makes diffs, and re-ordering nicer. - EnforcedStyleForMultiline: comma + EnforcedStyleForMultiline: consistent_comma +Style/TrailingCommaInArrayLiteral: + Description: Prefer always trailing comma on multiline argument lists. This makes + diffs, and re-ordering nicer. + EnforcedStyleForMultiline: consistent_comma +Style/TrailingCommaInHashLiteral: + Description: Prefer always trailing comma on multiline argument lists. This makes + diffs, and re-ordering nicer. + EnforcedStyleForMultiline: consistent_comma Style/SymbolArray: Description: Using percent style obscures symbolic intent of array's contents. EnforcedStyle: brackets diff --git a/.sync.yml b/.sync.yml index 7d1fbebb..1d857584 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,5 +1,6 @@ --- .github/workflows/ci.yaml: + acceptance_name: '${{ matrix.puppet }} ${{ matrix.set }} (slurm=${{ matrix.slurm_version }})' acceptance_matrix: set: - ---el7 @@ -11,6 +12,16 @@ puppet: - puppet7 - puppet8 + slurm_version: + - '23.11.10' + - '24.05.4' + #acceptance_includes: + # - set: el8 + # puppet: puppet7 + # slurm_version: '24.05.4' + # - set: el9 + # puppet: puppet7 + # slurm_version: '24.05.4' .gitlab-ci.yml: delete: true .rubocop.yml: diff --git a/Gemfile b/Gemfile index 60f20008..300688d3 100644 --- a/Gemfile +++ b/Gemfile @@ -29,8 +29,8 @@ group :system_tests do gem "beaker-pe", require: false gem "beaker-hostgenerator" gem "beaker-rspec" - gem "beaker-docker" - gem "beaker-puppet" + gem "beaker-docker", git: 'https://github.com/treydock/beaker-docker.git', branch: 'amazon-2023' + gem "beaker-puppet", git: 'https://github.com/puppetlabs/beaker-puppet.git', ref: '6063d22b6c4449df795731f5853c3c75241240c4' gem "beaker-puppet_install_helper", require: false gem "beaker-module_install_helper", require: false end diff --git a/README.md b/README.md index b2275dc0..366908e1 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Manage SLURM. ### Supported Versions of SLURM -This module is designed to work with SLURM 22.05.x, 23.02.x and 23.11.x. +This module is designed to work with SLURM 23.11.x and 24.05.x. | SLURM Version | SLURM Puppet module versions | | ----------------- | -----------------------------| @@ -36,6 +36,7 @@ This module is designed to work with SLURM 22.05.x, 23.02.x and 23.11.x. | 21.08.x & 22.05.x | 2.x | | 23.02.x | 3.x | | 23.11.x | 4.x | +| 23.11.x - 24.05.x | 5.x | ## Usage diff --git a/manifests/params.pp b/manifests/params.pp index 6f50b401..352ff3aa 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -32,7 +32,6 @@ 'CliFilterPlugins' => undef, 'CommunicationParameters' => undef, 'CompleteWait' => '0', - 'CoreSpecPlugin' => undef, 'CpuFreqDef' => undef, 'CpuFreqGovernors' => 'OnDemand,Performance,UserSpace', 'CredType' => 'cred/munge', diff --git a/manifests/partition.pp b/manifests/partition.pp index 9960961b..bfb02671 100644 --- a/manifests/partition.pp +++ b/manifests/partition.pp @@ -18,6 +18,7 @@ # @param deny_qos # @param default_time # @param disable_root_jobs +# @param exclusive_topo # @param exclusive_user # @param grace_time # @param hidden @@ -64,6 +65,7 @@ Optional[Variant[String[1], Array[String[1]]]] $deny_qos = undef, Optional[String[1]] $default_time = undef, Optional[Slurm::YesNo] $disable_root_jobs = undef, + Optional[Slurm::YesNo] $exclusive_topo = undef, Optional[Slurm::YesNo] $exclusive_user = undef, Optional[Variant[String[1], Integer]] $grace_time = undef, Optional[Slurm::YesNo] $hidden = undef, @@ -112,6 +114,7 @@ 'DenyAccounts' => $deny_accounts, 'DenyQos' => $deny_qos, 'DisableRootJobs' => $disable_root_jobs, + 'ExclusiveTopo' => $exclusive_topo, 'ExclusiveUser' => $exclusive_user, 'GraceTime' => $grace_time, 'Hidden' => $hidden, diff --git a/metadata.json b/metadata.json index 4b412e59..1ef2b664 100644 --- a/metadata.json +++ b/metadata.json @@ -38,7 +38,7 @@ }, { "name": "treydock/munge", - "version_requirement": ">= 1.1.0 <6.0.0" + "version_requirement": ">= 1.1.0 <7.0.0" }, { "name": "puppet/systemd", @@ -113,5 +113,5 @@ ], "pdk-version": "2.7.1", "template-url": "https://github.com/treydock/pdk-templates.git#master", - "template-ref": "heads/master-0-g52b1622" + "template-ref": "heads/master-0-gd2de99e" } diff --git a/spec/acceptance/shared_examples/common_install.rb b/spec/acceptance/shared_examples/common_install.rb index 2705e5c2..71326f1f 100644 --- a/spec/acceptance/shared_examples/common_install.rb +++ b/spec/acceptance/shared_examples/common_install.rb @@ -8,12 +8,12 @@ def packages 'libslurm-perl', 'libpmi0', 'libpmi2-0', - 'slurm-client' + 'slurm-client', ], slurmd: 'slurmd', slurmctld: 'slurmctld', slurmdbd: 'slurmdbd', - slurmrestd: nil + slurmrestd: nil, } else { @@ -24,12 +24,12 @@ def packages 'slurm-example-configs', 'slurm-perlapi', 'slurm-libpmi', - 'slurm-pam_slurm' + 'slurm-pam_slurm', ], slurmd: 'slurm-slurmd', slurmctld: 'slurm-slurmctld', slurmdbd: 'slurm-slurmdbd', - slurmrestd: 'slurm-slurmrestd' + slurmrestd: 'slurm-slurmrestd', } end end diff --git a/spec/classes/slurm_spec.rb b/spec/classes/slurm_spec.rb index b8dd270a..7fbc5423 100644 --- a/spec/classes/slurm_spec.rb +++ b/spec/classes/slurm_spec.rb @@ -23,7 +23,7 @@ slurmdbd: slurmdbd, database: database, slurmrestd: slurmrestd, - install_method: 'package' + install_method: 'package', } end let(:params) { default_params.merge(param_override) } diff --git a/spec/defines/slurm_conf_spec.rb b/spec/defines/slurm_conf_spec.rb index 25a1dbc8..8024578d 100644 --- a/spec/defines/slurm_conf_spec.rb +++ b/spec/defines/slurm_conf_spec.rb @@ -6,8 +6,8 @@ on_supported_os(supported_os: [ { 'operatingsystem' => 'RedHat', - 'operatingsystemrelease' => ['7'] - } + 'operatingsystemrelease' => ['7'], + }, ]).each do |_os, os_facts| let(:facts) { os_facts } let(:title) { 'ascend' } @@ -15,8 +15,8 @@ { configs: { 'ClusterName' => 'ascend', - 'SlurmctldHost' => 'ascend-slurm01.example.com' - } + 'SlurmctldHost' => 'ascend-slurm01.example.com', + }, } end diff --git a/spec/defines/slurm_gres_spec.rb b/spec/defines/slurm_gres_spec.rb index 62ef151d..25414474 100644 --- a/spec/defines/slurm_gres_spec.rb +++ b/spec/defines/slurm_gres_spec.rb @@ -6,8 +6,8 @@ on_supported_os(supported_os: [ { 'operatingsystem' => 'RedHat', - 'operatingsystemrelease' => ['7'] - } + 'operatingsystemrelease' => ['7'], + }, ]).each do |_os, os_facts| let(:facts) { os_facts } let(:title) { 'gpu' } diff --git a/spec/defines/slurm_job_container_spec.rb b/spec/defines/slurm_job_container_spec.rb index 57b5fe28..529d1264 100644 --- a/spec/defines/slurm_job_container_spec.rb +++ b/spec/defines/slurm_job_container_spec.rb @@ -6,8 +6,8 @@ on_supported_os(supported_os: [ { 'operatingsystem' => 'RedHat', - 'operatingsystemrelease' => ['7'] - } + 'operatingsystemrelease' => ['7'], + }, ]).each do |_os, os_facts| let(:facts) { os_facts } let(:title) { '/dev/shm' } diff --git a/spec/defines/slurm_nodeset_spec.rb b/spec/defines/slurm_nodeset_spec.rb index d088e146..dda78581 100644 --- a/spec/defines/slurm_nodeset_spec.rb +++ b/spec/defines/slurm_nodeset_spec.rb @@ -6,8 +6,8 @@ on_supported_os(supported_os: [ { 'operatingsystem' => 'RedHat', - 'operatingsystemrelease' => ['7'] - } + 'operatingsystemrelease' => ['7'], + }, ]).each do |_os, os_facts| let(:facts) { os_facts } let(:title) { 'test' } diff --git a/spec/defines/slurm_spank_spec.rb b/spec/defines/slurm_spank_spec.rb index b09bcf21..2cc28b9a 100644 --- a/spec/defines/slurm_spank_spec.rb +++ b/spec/defines/slurm_spank_spec.rb @@ -6,8 +6,8 @@ on_supported_os(supported_os: [ { 'operatingsystem' => 'RedHat', - 'operatingsystemrelease' => ['7'] - } + 'operatingsystemrelease' => ['7'], + }, ]).each do |_os, os_facts| let(:facts) { os_facts } let(:title) { 'x11' } @@ -20,7 +20,7 @@ it do is_expected.to contain_package('SLURM SPANK x11 package').only_with(ensure: 'installed', name: 'slurm-spank-x11', - notify: ['Service[slurmd]']) + notify: ['Service[slurmd]'],) end it do @@ -37,8 +37,8 @@ it do verify_fragment_contents(catalogue, 'plugstack.conf-x11', [ - 'required x11.so' - ]) + 'required x11.so', + ],) end end @@ -53,8 +53,8 @@ it do verify_fragment_contents(catalogue, 'plugstack.conf-x11', [ - 'optional x11.so ssh_cmd=ssh helpertask_cmd=2>/tmp/log' - ]) + 'optional x11.so ssh_cmd=ssh helpertask_cmd=2>/tmp/log', + ],) end end @@ -63,8 +63,8 @@ it do verify_fragment_contents(catalogue, 'plugstack.conf-x11', [ - 'optional x11.so ssh_cmd=ssh helpertask_cmd=2>/tmp/log' - ]) + 'optional x11.so ssh_cmd=ssh helpertask_cmd=2>/tmp/log', + ],) end end @@ -73,8 +73,8 @@ it do verify_fragment_contents(catalogue, 'plugstack.conf-x11', [ - 'optional x11.so helpertask_cmd=2>/tmp/log ssh_cmd=ssh' - ]) + 'optional x11.so helpertask_cmd=2>/tmp/log ssh_cmd=ssh', + ],) end end @@ -95,9 +95,9 @@ 'conf' => '/etc/auks/auks.conf', 'default' => 'enabled', 'spankstackcred' => 'no', - 'minimum_uid' => '0' + 'minimum_uid' => '0', }, - package_name: 'auks-slurm' + package_name: 'auks-slurm', } end @@ -105,8 +105,8 @@ it do verify_fragment_contents(catalogue, 'plugstack.conf-auks', [ - 'required auks.so conf=/etc/auks/auks.conf default=enabled spankstackcred=no minimum_uid=0' - ]) + 'required auks.so conf=/etc/auks/auks.conf default=enabled spankstackcred=no minimum_uid=0', + ],) end end diff --git a/spec/shared_examples/slurm_common_config.rb b/spec/shared_examples/slurm_common_config.rb index 52c4b2b7..e0bc47c7 100644 --- a/spec/shared_examples/slurm_common_config.rb +++ b/spec/shared_examples/slurm_common_config.rb @@ -122,8 +122,8 @@ 'UnkillableStepTimeout=60', 'UsePAM=0', 'VSizeFactor=0', - 'WaitTime=0' - ]) + 'WaitTime=0', + ],) end it do @@ -131,7 +131,7 @@ path: '/etc/slurm/topology.conf', owner: 'root', group: 'root', - mode: '0644') + mode: '0644',) end it do @@ -140,7 +140,7 @@ path: '/etc/slurm/gres.conf', owner: 'root', group: 'root', - mode: '0644') + mode: '0644',) else is_expected.not_to contain_concat('slurm-gres.conf') end @@ -151,7 +151,7 @@ path: '/etc/slurm/plugstack.conf', owner: 'root', group: 'root', - mode: '0644') + mode: '0644',) end it do @@ -159,7 +159,7 @@ path: '/etc/slurm/cgroup.conf', owner: 'root', group: 'root', - mode: '0644') + mode: '0644',) end it 'has cgroup.conf with valid contents' do @@ -174,8 +174,8 @@ 'ConstrainSwapSpace=no', 'MaxRAMPercent=100', 'MaxSwapPercent=100', - 'MinRAMSpace=30' - ]) + 'MinRAMSpace=30', + ],) end it do @@ -183,7 +183,7 @@ path: '/etc/slurm/oci.conf', owner: 'root', group: 'root', - mode: '0644') + mode: '0644',) end it 'has oci.conf with valid contents' do @@ -191,8 +191,8 @@ 'CreateEnvFile=disabled', 'DisableCleanup=false', 'MountSpoolDir="/var/run/slurm/"', - 'IgnoreFileConfigJson=false' - ]) + 'IgnoreFileConfigJson=false', + ],) end it { is_expected.not_to contain_file('/etc/slurm/cli_filter.lua') } @@ -202,7 +202,7 @@ it do is_expected.to contain_sysctl('net.core.somaxconn').with(ensure: 'present', - value: '1024') + value: '1024',) end context 'when cli_filter source is defined' do @@ -308,10 +308,10 @@ 'bf_continue' => '', 'defer' => '', 'batch_sched_delay' => '3', - 'bf_max_job_start' => 0 + 'bf_max_job_start' => 0, }, - 'TaskPlugin' => ['task/affinity', 'task/cgroup'] - } + 'TaskPlugin' => ['task/affinity', 'task/cgroup'], + }, } end @@ -321,8 +321,8 @@ 'PreemptType=preempt/partition_prio', 'ProctrackType=proctrack/linuxproc', 'SchedulerParameters=bf_continue,defer,batch_sched_delay=3,bf_max_job_start=0', - 'TaskPlugin=task/affinity,task/cgroup' - ]) + 'TaskPlugin=task/affinity,task/cgroup', + ],) end end @@ -330,7 +330,7 @@ let :param_override do { auth_alt_types: ['auth/jwt'], - jwt_key_source: 'puppet:///dne' + jwt_key_source: 'puppet:///dne', } end let(:slurmctld) { true } @@ -338,8 +338,8 @@ it 'enables JWT auth' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ 'AuthAltTypes=auth/jwt', - 'AuthAltParameters=jwt_key=/etc/slurm/jwt.key' - ]) + 'AuthAltParameters=jwt_key=/etc/slurm/jwt.key', + ],) end it 'defines JWT key' do @@ -359,16 +359,16 @@ { slurmctld_host: [ 'slurmctld1(10.0.0.1)', - 'slurmctld2(10.0.0.2)' - ] + 'slurmctld2(10.0.0.2)', + ], } end it 'overrides values' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ 'SlurmctldHost=slurmctld1(10.0.0.1)', - 'SlurmctldHost=slurmctld2(10.0.0.2)' - ]) + 'SlurmctldHost=slurmctld2(10.0.0.2)', + ],) end end @@ -379,27 +379,27 @@ 'DEFAULT' => { 'nodes' => 'c[0-9]', - 'state' => 'UP' + 'state' => 'UP', }, 'general' => { 'max_nodes' => '1', 'max_time' => '48:00:00', - 'default' => 'YES' - } - } + 'default' => 'YES', + }, + }, } end it do verify_exact_fragment_contents(catalogue, 'slurm.conf-partition-DEFAULT', [ - 'PartitionName=DEFAULT Nodes=c[0-9] State=UP' - ]) + 'PartitionName=DEFAULT Nodes=c[0-9] State=UP', + ],) end it do verify_exact_fragment_contents(catalogue, 'slurm.conf-partition-general', [ - 'PartitionName=general Default=YES MaxNodes=1 MaxTime=48:00:00 State=UP' - ]) + 'PartitionName=general Default=YES MaxNodes=1 MaxTime=48:00:00 State=UP', + ],) end end @@ -410,26 +410,26 @@ { 'cpus' => 4, 'node_hostname' => 'c01', - 'node_addr' => '10.0.0.1' + 'node_addr' => '10.0.0.1', }, 'c02' => { 'cpus' => 4, 'node_hostname' => 'c02', - 'node_addr' => '10.0.0.2' - } } + 'node_addr' => '10.0.0.2', + }, }, } end it do verify_exact_fragment_contents(catalogue, 'slurm.conf-node-c01', [ - 'NodeName=c01 NodeHostname=c01 NodeAddr=10.0.0.1 CPUs=4 State=UNKNOWN' - ]) + 'NodeName=c01 NodeHostname=c01 NodeAddr=10.0.0.1 CPUs=4 State=UNKNOWN', + ],) end it do verify_exact_fragment_contents(catalogue, 'slurm.conf-node-c02', [ - 'NodeName=c02 NodeHostname=c02 NodeAddr=10.0.0.2 CPUs=4 State=UNKNOWN' - ]) + 'NodeName=c02 NodeHostname=c02 NodeAddr=10.0.0.2 CPUs=4 State=UNKNOWN', + ],) end end @@ -438,24 +438,24 @@ { switches: { 'switch01' => { - 'nodes' => 'c01' + 'nodes' => 'c01', }, 'switch00' => { - 'switches' => 'switch01' - } } + 'switches' => 'switch01', + }, }, } end it do verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch01', [ - 'SwitchName=switch01 Nodes=c01' - ]) + 'SwitchName=switch01 Nodes=c01', + ],) end it do verify_exact_fragment_contents(catalogue, 'slurm-topology.conf-switch00', [ - 'SwitchName=switch00 Switches=switch01' - ]) + 'SwitchName=switch00 Switches=switch01', + ],) end end @@ -465,29 +465,29 @@ greses: { 'gpu' => { 'node_name' => 'c0[1-2]', - 'file' => '/dev/nvidia[0-1]' + 'file' => '/dev/nvidia[0-1]', }, 'gpu2' => { 'gres_name' => 'gpu', 'node_name' => 'c0[3-4]', - 'file' => '/dev/nvidia[0-3]' - } } + 'file' => '/dev/nvidia[0-3]', + }, }, } end it do if slurmd verify_exact_fragment_contents(catalogue, 'slurm-gres.conf-gpu', [ - 'NodeName=c0[1-2] Name=gpu File=/dev/nvidia[0-1]' - ]) + 'NodeName=c0[1-2] Name=gpu File=/dev/nvidia[0-1]', + ],) end end it do if slurmd verify_exact_fragment_contents(catalogue, 'slurm-gres.conf-gpu2', [ - 'NodeName=c0[3-4] Name=gpu File=/dev/nvidia[0-3]' - ]) + 'NodeName=c0[3-4] Name=gpu File=/dev/nvidia[0-3]', + ],) end end end @@ -500,7 +500,7 @@ oci_run_time_delete: 'runc delete', oci_run_time_kill: 'runc kill', oci_run_time_query: 'runc query', - oci_run_time_run: 'runc run' + oci_run_time_run: 'runc run', } end @@ -515,8 +515,8 @@ 'RunTimeDelete="runc delete"', 'RunTimeKill="runc kill"', 'RunTimeQuery="runc query"', - 'RunTimeRun="runc run"' - ]) + 'RunTimeRun="runc run"', + ],) end end diff --git a/spec/shared_examples/slurm_common_install_source.rb b/spec/shared_examples/slurm_common_install_source.rb index d4212d40..eb9e8b14 100644 --- a/spec/shared_examples/slurm_common_install_source.rb +++ b/spec/shared_examples/slurm_common_install_source.rb @@ -28,8 +28,8 @@ it do verify_contents(catalogue, "/usr/local/src/slurm-#{params[:version]}/puppet-install.sh", [ - './configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc/slurm --enable-slurmrestd ' - ]) + './configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc/slurm --enable-slurmrestd ', + ],) end it do diff --git a/spec/shared_examples/slurm_common_setup.rb b/spec/shared_examples/slurm_common_setup.rb index f658b6a0..d979c366 100644 --- a/spec/shared_examples/slurm_common_setup.rb +++ b/spec/shared_examples/slurm_common_setup.rb @@ -14,13 +14,13 @@ path: '/etc/profile.d/slurm.sh', owner: 'root', group: 'root', - mode: '0644') + mode: '0644',) end it do verify_contents(catalogue, '/etc/profile.d/slurm.sh', [ - 'export SLURM_CONF="/etc/slurm/slurm.conf"' - ]) + 'export SLURM_CONF="/etc/slurm/slurm.conf"', + ],) end it do @@ -28,13 +28,13 @@ path: '/etc/profile.d/slurm.csh', owner: 'root', group: 'root', - mode: '0644') + mode: '0644',) end it do verify_contents(catalogue, '/etc/profile.d/slurm.csh', [ - 'setenv SLURM_CONF "/etc/slurm/slurm.conf"' - ]) + 'setenv SLURM_CONF "/etc/slurm/slurm.conf"', + ],) end it do @@ -42,7 +42,7 @@ path: '/etc/slurm', owner: 'root', group: 'root', - mode: '0755') + mode: '0755',) end it do @@ -50,7 +50,7 @@ is_expected.to contain_file('/var/log/slurm').with(ensure: 'directory', owner: 'slurm', group: 'slurm', - mode: '0700') + mode: '0700',) else is_expected.not_to contain_file('/var/log/slurm') end @@ -75,8 +75,8 @@ 'pkill -x --signal SIGUSR2 slurmctld', 'pkill -x --signal SIGUSR2 slurmd', 'pkill -x --signal SIGUSR2 slurmdbd', - 'exit 0' - ]) + 'exit 0', + ],) else is_expected.not_to contain_logrotate__rule('slurm') end @@ -87,14 +87,14 @@ it do verify_contents(catalogue, '/etc/profile.d/slurm.sh', [ - 'export FOO="bar"' - ]) + 'export FOO="bar"', + ],) end it do verify_contents(catalogue, '/etc/profile.d/slurm.csh', [ - 'setenv FOO "bar"' - ]) + 'setenv FOO "bar"', + ],) end end @@ -112,7 +112,7 @@ is_expected.to contain_logrotate__rule('slurm').with( postrotate: [ "/bin/kill -HUP `cat #{syslog_pid} 2> /dev/null` 2> /dev/null || true", - 'exit 0' + 'exit 0', ], ) else @@ -129,7 +129,7 @@ postrotate: [ "/bin/kill -HUP `cat #{syslog_pid} 2> /dev/null` 2> /dev/null || true", 'pkill -x --signal SIGUSR2 slurmctld', - 'exit 0' + 'exit 0', ], ) end diff --git a/spec/shared_examples/slurm_common_user.rb b/spec/shared_examples/slurm_common_user.rb index d3068613..3dc7642e 100644 --- a/spec/shared_examples/slurm_common_user.rb +++ b/spec/shared_examples/slurm_common_user.rb @@ -14,7 +14,7 @@ name: 'slurm', gid: nil, forcelocal: 'true', - system: 'true') + system: 'true',) end it do @@ -27,7 +27,7 @@ managehome: 'true', comment: 'SLURM User', forcelocal: 'true', - system: 'true') + system: 'true',) end context 'when slurm_group_gid => 400' do diff --git a/spec/shared_examples/slurm_slurmctld.rb b/spec/shared_examples/slurm_slurmctld.rb index 84135d4e..b8bead90 100644 --- a/spec/shared_examples/slurm_slurmctld.rb +++ b/spec/shared_examples/slurm_slurmctld.rb @@ -26,7 +26,7 @@ it do is_expected.to contain_firewall('100 allow access to slurmctld').with(proto: 'tcp', dport: '6817', - action: 'accept') + action: 'accept',) end context 'when manage_firewall => false' do diff --git a/spec/shared_examples/slurm_slurmctld_config.rb b/spec/shared_examples/slurm_slurmctld_config.rb index b92b9cce..04e86169 100644 --- a/spec/shared_examples/slurm_slurmctld_config.rb +++ b/spec/shared_examples/slurm_slurmctld_config.rb @@ -6,7 +6,7 @@ path: '/var/spool/slurmctld.state', owner: 'slurm', group: 'slurm', - mode: '0700') + mode: '0700',) end it { is_expected.not_to contain_mount('StateSaveLocation') } @@ -21,7 +21,7 @@ device: '192.168.1.1:/slurm/state', fstype: 'nfs', options: 'rw,sync,noexec,nolock,auto', - before: 'File[StateSaveLocation]') + before: 'File[StateSaveLocation]',) end end end diff --git a/spec/shared_examples/slurm_slurmctld_service.rb b/spec/shared_examples/slurm_slurmctld_service.rb index d52b0d4c..07efbf3f 100644 --- a/spec/shared_examples/slurm_slurmctld_service.rb +++ b/spec/shared_examples/slurm_slurmctld_service.rb @@ -5,7 +5,7 @@ is_expected.to contain_service('slurmctld').with(ensure: 'running', enable: 'true', hasstatus: 'true', - hasrestart: 'true') + hasrestart: 'true',) end it do diff --git a/spec/shared_examples/slurm_slurmd.rb b/spec/shared_examples/slurm_slurmd.rb index 242d954e..a9dca3f8 100644 --- a/spec/shared_examples/slurm_slurmd.rb +++ b/spec/shared_examples/slurm_slurmd.rb @@ -26,7 +26,7 @@ it do is_expected.to contain_firewall('100 allow access to slurmd').with(proto: 'tcp', dport: '6818', - action: 'accept') + action: 'accept',) end context 'when manage_firewall => false' do diff --git a/spec/shared_examples/slurm_slurmd_config.rb b/spec/shared_examples/slurm_slurmd_config.rb index a66296db..0c485216 100644 --- a/spec/shared_examples/slurm_slurmd_config.rb +++ b/spec/shared_examples/slurm_slurmd_config.rb @@ -15,8 +15,8 @@ it 'sets the Epilog option' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ - 'Epilog=/tmp/foo' - ]) + 'Epilog=/tmp/foo', + ],) end it do @@ -25,7 +25,7 @@ source: nil, owner: 'root', group: 'root', - mode: '0755') + mode: '0755',) end end @@ -34,8 +34,8 @@ it 'sets the Epilog option' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ - 'Epilog=/tmp/foo.d/*' - ]) + 'Epilog=/tmp/foo.d/*', + ],) end it do @@ -47,7 +47,7 @@ mode: '0755', recurse: 'true', recurselimit: '1', - purge: 'true') + purge: 'true',) end end @@ -56,8 +56,8 @@ it 'sets the HealthCheckProgram option' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ - 'HealthCheckProgram=/usr/sbin/nhc' - ]) + 'HealthCheckProgram=/usr/sbin/nhc', + ],) end end @@ -66,8 +66,8 @@ it 'sets the Prolog option' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ - 'Prolog=/tmp/bar' - ]) + 'Prolog=/tmp/bar', + ],) end it do @@ -76,7 +76,7 @@ source: nil, owner: 'root', group: 'root', - mode: '0755') + mode: '0755',) end end @@ -85,8 +85,8 @@ it 'sets the Prolog option' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ - 'Prolog=/tmp/bar.d/*' - ]) + 'Prolog=/tmp/bar.d/*', + ],) end it do @@ -98,7 +98,7 @@ mode: '0755', recurse: 'true', recurselimit: '1', - purge: 'true') + purge: 'true',) end end @@ -107,8 +107,8 @@ it 'sets the TaskEpilog option' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ - 'TaskEpilog=/tmp/epilog' - ]) + 'TaskEpilog=/tmp/epilog', + ],) end it do @@ -117,7 +117,7 @@ source: nil, owner: 'root', group: 'root', - mode: '0755') + mode: '0755',) end end @@ -126,8 +126,8 @@ it 'sets the TaskProlog option' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ - 'TaskProlog=/tmp/foobar' - ]) + 'TaskProlog=/tmp/foobar', + ],) end it do @@ -136,7 +136,7 @@ source: nil, owner: 'root', group: 'root', - mode: '0755') + mode: '0755',) end end @@ -145,6 +145,6 @@ path: '/var/spool/slurmd', owner: 'root', group: 'root', - mode: '0755') + mode: '0755',) end end diff --git a/spec/shared_examples/slurm_slurmd_service.rb b/spec/shared_examples/slurm_slurmd_service.rb index 792dd92b..f4c28cf7 100644 --- a/spec/shared_examples/slurm_slurmd_service.rb +++ b/spec/shared_examples/slurm_slurmd_service.rb @@ -5,6 +5,6 @@ is_expected.to contain_service('slurmd').with(ensure: 'running', enable: 'true', hasstatus: 'true', - hasrestart: 'true') + hasrestart: 'true',) end end diff --git a/spec/shared_examples/slurm_slurmdbd_config.rb b/spec/shared_examples/slurm_slurmdbd_config.rb index c33e8d8d..b0566a19 100644 --- a/spec/shared_examples/slurm_slurmdbd_config.rb +++ b/spec/shared_examples/slurm_slurmdbd_config.rb @@ -6,7 +6,7 @@ path: '/etc/slurm/slurmdbd.conf', owner: 'slurm', group: 'slurm', - mode: '0600') + mode: '0600',) end it do @@ -38,8 +38,8 @@ 'StorageType=accounting_storage/mysql', 'StorageUser=slurmdbd', 'TCPTimeout=2', - 'TrackSlurmctldDown=no' - ]) + 'TrackSlurmctldDown=no', + ],) end context 'when slurmdbd_conf_override defined' do @@ -54,15 +54,15 @@ let :param_override do { auth_alt_types: ['auth/jwt'], - jwt_key_source: 'puppet:///dne' + jwt_key_source: 'puppet:///dne', } end it 'overrides values' do verify_fragment_contents(catalogue, 'slurm.conf-config', [ 'AuthAltTypes=auth/jwt', - 'AuthAltParameters=jwt_key=/etc/slurm/jwt.key' - ]) + 'AuthAltParameters=jwt_key=/etc/slurm/jwt.key', + ],) end end diff --git a/spec/shared_examples/slurm_slurmdbd_db.rb b/spec/shared_examples/slurm_slurmdbd_db.rb index 06ca3587..30a3f9e5 100644 --- a/spec/shared_examples/slurm_slurmdbd_db.rb +++ b/spec/shared_examples/slurm_slurmdbd_db.rb @@ -5,7 +5,7 @@ is_expected.to contain_mysql__db('slurm_acct_db').with(user: 'slurmdbd', password: 'slurmdbd', host: 'localhost', - grant: ['ALL']) + grant: ['ALL'],) end context 'when export_database => true' do diff --git a/spec/shared_examples/slurm_slurmdbd_service.rb b/spec/shared_examples/slurm_slurmdbd_service.rb index bf428bc8..65759df6 100644 --- a/spec/shared_examples/slurm_slurmdbd_service.rb +++ b/spec/shared_examples/slurm_slurmdbd_service.rb @@ -5,6 +5,6 @@ is_expected.to contain_service('slurmdbd').with(ensure: 'running', enable: 'true', hasstatus: 'true', - hasrestart: 'true') + hasrestart: 'true',) end end diff --git a/spec/shared_examples/slurm_slurmrestd_service.rb b/spec/shared_examples/slurm_slurmrestd_service.rb index 1b299ca7..8a3be6c0 100644 --- a/spec/shared_examples/slurm_slurmrestd_service.rb +++ b/spec/shared_examples/slurm_slurmrestd_service.rb @@ -5,6 +5,6 @@ is_expected.to contain_service('slurmrestd').with(ensure: 'running', enable: 'true', hasstatus: 'true', - hasrestart: 'true') + hasrestart: 'true',) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7272754c..c854cc5a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,12 +13,12 @@ default_facts = { puppetversion: Puppet.version, - facterversion: Facter.version + facterversion: Facter.version, } default_fact_files = [ File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')), - File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')) + File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')), ] default_fact_files.each do |f| diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index d0d3a82b..be13d866 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -9,7 +9,8 @@ Dir["#{dir}/acceptance/shared_examples/**/*.rb"].sort.each { |f| require f } require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb')) -run_puppet_install_helper +run_puppet_install_helper unless ['debian-12', 'ubuntu-2404'].include?(ENV['BEAKER_set']) +on hosts, 'apt install -y puppet-agent' if ['debian-12', 'ubuntu-2404'].include?(ENV['BEAKER_set']) install_module_on(hosts) install_module_dependencies_on(hosts) diff --git a/spec/spec_helper_acceptance_setup.rb b/spec/spec_helper_acceptance_setup.rb index 3895ae7b..ab8437c5 100644 --- a/spec/spec_helper_acceptance_setup.rb +++ b/spec/spec_helper_acceptance_setup.rb @@ -11,7 +11,7 @@ c.slurm_repo_baseurl = ENV['SLURM_BEAKER_repo_baseurl'] || nil c.add_setting :slurm_version - c.slurm_version = ENV['SLURM_BEAKER_version'] || '23.11.5' + c.slurm_version = ENV['BEAKER_slurm_version'] || '23.11.5' if ENV['BEAKER_set'] =~ %r{cluster} slurmctld_host = 'slurmctld' @@ -82,39 +82,10 @@ slurmd: cpus: 1 HIERA - rhel7_yaml = <<-RHEL7 -slurm::cgroup_plugin: 'cgroup/v1' - RHEL7 create_remote_file(hosts, '/etc/puppetlabs/puppet/hiera.yaml', hiera_yaml) on hosts, 'mkdir -p /etc/puppetlabs/puppet/data' create_remote_file(hosts, '/etc/puppetlabs/puppet/data/common.yaml', common_yaml) - create_remote_file(hosts, '/etc/puppetlabs/puppet/data/RedHat7.yaml', rhel7_yaml) - # Hack to work around issues with recent systemd and docker and running services as non-root - if fact('os.family') == 'RedHat' && fact('os.release.major').to_i >= 7 - service_hack = <<-HACK -[Service] -User=root -Group=root -ExecStart= -ExecStart=/usr/sbin/munged --force - HACK - on hosts, 'mkdir -p /etc/systemd/system/munge.service.d' - create_remote_file(hosts, '/etc/systemd/system/munge.service.d/hack.conf', service_hack) - tmp_hack = <<-HACK -d /run/munge 0755 root root - - HACK - create_remote_file(hosts, '/usr/lib/tmpfiles.d/munge.conf', tmp_hack) - - munge_yaml = <<-MUNGE -munge::manage_user: false -munge::user: root -munge::group: root -munge::lib_dir: /var/lib/munge -munge::log_dir: /var/log/munge -munge::conf_dir: /etc/munge -munge::run_dir: /run/munge - MUNGE - create_remote_file(hosts, '/etc/puppetlabs/puppet/data/munge.yaml', munge_yaml) - end + # For some reason /etc ends up with wrong permissions. + on hosts, 'chmod 0755 /etc' end end diff --git a/spec/spec_helper_local.rb b/spec/spec_helper_local.rb index fb549598..19483d13 100644 --- a/spec/spec_helper_local.rb +++ b/spec/spec_helper_local.rb @@ -13,7 +13,7 @@ def base_packages(facts) 'libslurm-perl', 'libpmi0', 'libpmi2-0', - 'slurm-client' + 'slurm-client', ] else [ @@ -23,7 +23,7 @@ def base_packages(facts) 'slurm-example-configs', 'slurm-perlapi', 'slurm-libpmi', - 'slurm-pam_slurm' + 'slurm-pam_slurm', ] end end