diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c7e58ec..9445aaa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -55,6 +55,7 @@ jobs: - "amazon2023" - "ubuntu-2004" - "ubuntu-2204" + - "ubuntu-2404" - "debian-12" puppet: - "puppet7" diff --git a/.rubocop.yml b/.rubocop.yml index 3b93cd8..9f6b1ec 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 5c815ae..10b0a85 100644 --- a/.sync.yml +++ b/.sync.yml @@ -13,6 +13,7 @@ Rakefile: - amazon2023 - ubuntu-2004 - ubuntu-2204 + - ubuntu-2404 - debian-12 puppet: - puppet7 @@ -51,6 +52,12 @@ spec/acceptance/nodesets/ubuntu-2204.yml: default_module_install_opts: ignore-dependencies: ~ force: ~ +spec/acceptance/nodesets/ubuntu-2404.yml: + packages: + - cron + default_module_install_opts: + ignore-dependencies: ~ + force: ~ spec/acceptance/nodesets/debian-12.yml: packages: - cron diff --git a/manifests/init.pp b/manifests/init.pp index ec1700f..39af7cb 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -399,7 +399,7 @@ $osname = $facts.dig('os', 'name') $osmajor = $facts.dig('os', 'release', 'major') - $supported = ['RedHat-7','RedHat-8','RedHat-9','RedHat-2023','Debian-20.04','Debian-22.04','Debian-12'] + $supported = ['RedHat-7','RedHat-8','RedHat-9','RedHat-2023','Debian-20.04','Debian-22.04','Debian-24.04','Debian-12'] $os = "${osfamily}-${osmajor}" if ! ($os in $supported) { fail("Unsupported OS: module ${module_name}. osfamily=${osfamily} osmajor=${osmajor} detected") @@ -418,6 +418,9 @@ if "${osname}-${osmajor}" == 'Debian-12' { fail('Debian 12 is not supported with OnDemand 3.0') } + if "${osname}-${osmajor}" == 'Ubuntu-24.04' { + fail('Ubuntu 24.04 is not supported with OnDemand 3.0') + } } if versioncmp($osmajor, '7') <= 0 { diff --git a/manifests/repo/apt.pp b/manifests/repo/apt.pp index 56305cb..328cdcf 100644 --- a/manifests/repo/apt.pp +++ b/manifests/repo/apt.pp @@ -26,7 +26,7 @@ } # Debian 12 has NodeJS 18 in OS repos - if String($openondemand::osmajor) != '12' and $openondemand::nodejs == '18' { + if ! (String($openondemand::osmajor) in ['12', '24.04']) and $openondemand::nodejs == '18' { apt::source { 'nodesource': ensure => 'present', location => 'https://deb.nodesource.com/node_18.x', diff --git a/metadata.json b/metadata.json index 24da930..f8434ed 100644 --- a/metadata.json +++ b/metadata.json @@ -18,7 +18,7 @@ }, { "name": "puppetlabs/apache", - "version_requirement": ">= 5.2.0 < 12.0.0" + "version_requirement": ">= 5.2.0 < 13.0.0" }, { "name": "puppetlabs/vcsrepo", @@ -77,7 +77,8 @@ "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "20.04", - "22.04" + "22.04", + "24.04" ] }, { @@ -100,5 +101,5 @@ ], "pdk-version": "2.7.1", "template-url": "https://github.com/treydock/pdk-templates.git#master", - "template-ref": "heads/master-0-g50afcd2" + "template-ref": "heads/master-0-gd2de99e" } diff --git a/spec/acceptance/nodesets/ubuntu-2404.yml b/spec/acceptance/nodesets/ubuntu-2404.yml new file mode 100644 index 0000000..ebb9279 --- /dev/null +++ b/spec/acceptance/nodesets/ubuntu-2404.yml @@ -0,0 +1,28 @@ +HOSTS: + ubuntu2404: + roles: + - agent + platform: ubuntu-24.04-amd64 + hypervisor : docker + image: ubuntu:24.04 + docker_preserve_image: true + docker_cmd: '["/sbin/init"]' + docker_image_commands: + - "rm -f /etc/dpkg/dpkg.cfg.d/excludes" + - 'apt-get install -y wget net-tools iproute2 locales apt-transport-https ca-certificates cron' + - 'locale-gen en_US.UTF-8' + docker_env: + - LANG=en_US.UTF-8 + - LANGUAGE=en_US.UTF-8 + - LC_ALL=en_US.UTF-8 + docker_container_name: 'openondemand-ubuntu2404' + default_module_install_opts: + ignore-dependencies: + force: +CONFIG: + log_level: debug + type: foss +ssh: + password: root + auth_methods: ["password"] + diff --git a/spec/defines/app_usr_spec.rb b/spec/defines/app_usr_spec.rb index 983f89e..353d2d4 100644 --- a/spec/defines/app_usr_spec.rb +++ b/spec/defines/app_usr_spec.rb @@ -21,7 +21,7 @@ is_expected.to contain_file('/var/www/ood/apps/usr/test').with('ensure' => 'directory', 'owner' => 'root', 'group' => 'root', - 'mode' => '0750') + 'mode' => '0750',) end end end diff --git a/spec/defines/cluster_spec.rb b/spec/defines/cluster_spec.rb index ced7bc9..b230c84 100644 --- a/spec/defines/cluster_spec.rb +++ b/spec/defines/cluster_spec.rb @@ -19,21 +19,21 @@ { 'adapter' => 'group', 'groups' => ['test-group'], - 'type' => 'whitelist' - } + 'type' => 'whitelist', + }, ], rsv_query_acls: [ { 'adapter' => 'group', 'groups' => ['test-group-rsv'], - 'type' => 'blacklist' - } + 'type' => 'blacklist', + }, ], login_host: 'login.test', batch_connect: { 'basic' => { 'script_wrapper' => 'module restore\n%s' }, - 'vnc' => { 'script_wrapper' => 'module restore\nmodule load ondemand-vnc\n%s' } - } + 'vnc' => { 'script_wrapper' => 'module restore\nmodule load ondemand-vnc\n%s' }, + }, } end @@ -43,7 +43,7 @@ is_expected.to contain_file('/etc/ood/config/clusters.d/test.yml').with('ensure' => 'file', 'owner' => 'root', 'group' => 'root', - 'mode' => '0644') + 'mode' => '0644',) end it do @@ -62,10 +62,10 @@ job_username_prefix: 'dev', job_server: { 'endpoint' => 'https://k8dev.example.com:6443', 'cert_authority_file' => '/etc/k8dev.crt' }, job_mounts: [ - { 'name' => 'home', 'destination_path' => '/home', 'path' => '/home', 'host_type' => 'Directory', 'type' => 'host' } + { 'name' => 'home', 'destination_path' => '/home', 'path' => '/home', 'host_type' => 'Directory', 'type' => 'host' }, ], job_auth: { 'type' => 'oidc' }, - batch_connect: { 'ssh_allow' => false } + batch_connect: { 'ssh_allow' => false }, } end @@ -92,10 +92,10 @@ jupyter: { AI_BOOTCAMP_OSC: { hours: 3, - project: 'FOO' - } - } - } + project: 'FOO', + }, + }, + }, }, ) end @@ -143,7 +143,7 @@ grafana_dashboard_name: 'test', grafana_dashboard_uid: 'foo', grafana_dashboard_panels: { 'cpu' => 1, 'memory' => 2 }, - grafana_labels: { 'cluster' => 'cluster', 'host' => 'host' } + grafana_labels: { 'cluster' => 'cluster', 'host' => 'host' }, } end diff --git a/spec/defines/install_app_spec.rb b/spec/defines/install_app_spec.rb index 1335cf0..1783f2f 100644 --- a/spec/defines/install_app_spec.rb +++ b/spec/defines/install_app_spec.rb @@ -36,7 +36,7 @@ context 'when git repo' do let :params do { - 'git_repo' => 'https://github.com/foo/test' + 'git_repo' => 'https://github.com/foo/test', } end @@ -58,7 +58,7 @@ context 'when source' do let(:params) do { - 'source' => 'puppet:///modules/apps' + 'source' => 'puppet:///modules/apps', } end diff --git a/spec/shared_examples/config.rb b/spec/shared_examples/config.rb index 3eaca18..3ef8872 100644 --- a/spec/shared_examples/config.rb +++ b/spec/shared_examples/config.rb @@ -9,8 +9,8 @@ let(:params) do { nginx_stage_passenger_options: { - 'passenger_foobar' => 'baz' - } + 'passenger_foobar' => 'baz', + }, } end @@ -28,7 +28,7 @@ 'pinned_apps' => [ 'usr/*', 'sys/jupyter', - { 'type' => 'dev', 'category' => 'system' } + { 'type' => 'dev', 'category' => 'system' }, ], 'pinned_apps_menu_length' => 10, 'pinned_apps_group_by' => 'category', @@ -37,11 +37,11 @@ { 'columns' => [ { 'width' => 8, 'widgets' => ['pinned_apps', 'motd'] }, - { 'width' => 4, 'widgets' => ['xdmod_widget_job_efficiency', 'xdmod_widget_jobs'] } - ] - } - ] - } + { 'width' => 4, 'widgets' => ['xdmod_widget_job_efficiency', 'xdmod_widget_jobs'] }, + ], + }, + ], + }, } end @@ -81,8 +81,8 @@ 'IDP_ISSUER_URL' => 'https://idp.example.com/auth/realms/main/protocol/openid-connect/token', 'IMAGE_PULL_SECRET' => 'private-docker-registry', 'REGISTRY_DOCKER_CONFIG_JSON' => '/etc/docker-registry-auth/robot-ondemand-read.json', - 'USE_JOB_POD_REAPER' => true - } + 'USE_JOB_POD_REAPER' => true, + }, } end @@ -96,8 +96,8 @@ 'IDP_ISSUER_URL="https://idp.example.com/auth/realms/main/protocol/openid-connect/token"', 'IMAGE_PULL_SECRET="private-docker-registry"', 'REGISTRY_DOCKER_CONFIG_JSON="/etc/docker-registry-auth/robot-ondemand-read.json"', - 'USE_JOB_POD_REAPER="true"' - ]) + 'USE_JOB_POD_REAPER="true"', + ],) end end @@ -107,8 +107,8 @@ nginx_stage_configs: { 'foo' => 'bar', 'bar' => false, - 'baz' => ['foo', 'bar'] - } + 'baz' => ['foo', 'bar'], + }, } end diff --git a/spec/shared_examples/repo_apt.rb b/spec/shared_examples/repo_apt.rb index c678efc..01bb072 100644 --- a/spec/shared_examples/repo_apt.rb +++ b/spec/shared_examples/repo_apt.rb @@ -9,7 +9,7 @@ release: facts[:os]['distro']['codename'], key: { 'id' => 'FE143EA1CB378B569BBF7C544B72FE2B92D31755', - 'source' => 'https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand' + 'source' => 'https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand', }, ) end @@ -22,12 +22,12 @@ release: facts[:os]['distro']['codename'], key: { 'id' => 'FE143EA1CB378B569BBF7C544B72FE2B92D31755', - 'source' => 'https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand' + 'source' => 'https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand', }, ) end - if facts[:os]['release']['major'].to_i != 12 + if facts[:os]['release']['major'].to_i != 12 && facts[:os]['release']['major'].to_s != '24.04' it do is_expected.to contain_apt__source('nodesource').with( ensure: 'present', @@ -36,7 +36,7 @@ release: 'nodistro', key: { 'id' => '6F71F525282841EEDAF851B42F59B5F99B1BE0B4', - 'source' => 'https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key' + 'source' => 'https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key', }, ) end @@ -44,7 +44,7 @@ it { is_expected.not_to contain_apt__source('nodesource') } end - context 'when repo_release => 3.0', if: facts[:os]['release']['major'].to_i != 12 do + context 'when repo_release => 3.0', if: facts[:os]['release']['major'].to_i != 12 && facts[:os]['release']['major'].to_s != '24.04' do let(:params) { { repo_release: '3.0' } } it do @@ -55,7 +55,7 @@ release: facts[:os]['distro']['codename'], key: { 'id' => '9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280', - 'source' => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key' + 'source' => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key', }, ) end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7272754..c854cc5 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 09cf9fa..be13d86 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -9,8 +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 unless ENV['BEAKER_set'] == 'debian-12' -on hosts, 'apt install -y puppet-agent' if ENV['BEAKER_set'] == 'debian-12' +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 8eed535..b4a80dd 100644 --- a/spec/spec_helper_acceptance_setup.rb +++ b/spec/spec_helper_acceptance_setup.rb @@ -8,7 +8,7 @@ def supported_releases osname = fact('os.name') osfamily = fact('os.family') osmajor = fact('os.release.major') - if ['Amazon-2023', 'Debian-12'].include?("#{osname}-#{osmajor}") + if ['Amazon-2023', 'Debian-12', 'Ubuntu-24.04'].include?("#{osname}-#{osmajor}") ['3.1'] elsif "#{osfamily}-#{osmajor}" == 'RedHat-7' ['3.0'] @@ -50,7 +50,7 @@ def supported_releases '--cert-key-file /etc/pki/tls/private/localhost.key', '--ca-file /etc/pki/tls/certs/localhost.crt', '--dhparams-file /tmp/dhparams.pem --lifetime 365', - '--hostname $(hostname) --email root@$(hostname)' + '--hostname $(hostname) --email root@$(hostname)', ] on hosts, cert_bootstrap.join(' ') end diff --git a/spec/type_aliases/dashboard_layout_spec.rb b/spec/type_aliases/dashboard_layout_spec.rb index e75bda5..7bfd438 100644 --- a/spec/type_aliases/dashboard_layout_spec.rb +++ b/spec/type_aliases/dashboard_layout_spec.rb @@ -10,10 +10,10 @@ { 'columns' => [ { 'width' => 8, 'widgets' => ['pinned_apps', 'motd'] }, - { 'width' => 4, 'widgets' => ['xdmod_widget_job_efficiency', 'xdmod_widget_jobs'] } - ] - } - ] + { 'width' => 4, 'widgets' => ['xdmod_widget_job_efficiency', 'xdmod_widget_jobs'] }, + ], + }, + ], } is_expected.to allow_value(value) end diff --git a/spec/type_aliases/dex_config_spec.rb b/spec/type_aliases/dex_config_spec.rb index 3c43ddd..31a6412 100644 --- a/spec/type_aliases/dex_config_spec.rb +++ b/spec/type_aliases/dex_config_spec.rb @@ -12,9 +12,9 @@ 'type' => 'ldap', 'id' => 'ldap', 'config' => { - 'host' => 'ldap.example.org' - } - }] + 'host' => 'ldap.example.org', + }, + }], } is_expected.to allow_value(value) end