From 1cc9da640d6ac66f6a0c8aafc11ef7224ba86cf4 Mon Sep 17 00:00:00 2001 From: treydock Date: Wed, 10 Apr 2024 12:20:30 -0400 Subject: [PATCH] Support perfSONAR 5, Drop EL7 and Debian 10 (#24) --- .fixtures.yml | 15 +++++++------- .github/workflows/ci.yaml | 3 --- .sync.yml | 10 ++++++--- Gemfile | 6 +++--- manifests/init.pp | 2 +- manifests/repo.pp | 22 +++++++++----------- metadata.json | 15 +------------- spec/acceptance/nodesets/debian-10.yml | 28 -------------------------- spec/acceptance/nodesets/el7.yml | 26 ------------------------ spec/classes/perfsonar_spec.rb | 2 +- spec/spec_helper_acceptance.rb | 3 ++- spec/spec_helper_acceptance_setup.rb | 22 -------------------- 12 files changed, 33 insertions(+), 121 deletions(-) delete mode 100644 spec/acceptance/nodesets/debian-10.yml delete mode 100644 spec/acceptance/nodesets/el7.yml delete mode 100644 spec/spec_helper_acceptance_setup.rb diff --git a/.fixtures.yml b/.fixtures.yml index 0519180..193e5c5 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,18 +3,19 @@ --- fixtures: - repositories: + forge_modules: stdlib: - repo: https://github.com/puppetlabs/puppetlabs-stdlib.git + repo: puppetlabs/stdlib apt: - repo: https://github.com/puppetlabs/puppetlabs-apt.git + repo: puppetlabs/apt yumrepo_core: - repo: https://github.com/puppetlabs/puppetlabs-yumrepo_core.git + repo: puppetlabs/yumrepo_core firewall: - repo: https://github.com/puppetlabs/puppetlabs-firewall.git + repo: puppetlabs/firewall + ref: '6.0.0' epel: - repo: https://github.com/voxpupuli/puppet-epel.git + repo: puppet/epel httpauth: - repo: https://github.com/jamtur01/jamtur01-httpauth.git + repo: jamtur01/httpauth symlinks: perfsonar: "#{source_dir}" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5dd25c0..0518167 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,11 +48,8 @@ jobs: fail-fast: false matrix: set: - - "el7" - "el8" - "el9" - - "debian-10" - - "ubuntu-2004" puppet: - "puppet7" - "puppet8" diff --git a/.sync.yml b/.sync.yml index 263f1a5..5e22d5a 100644 --- a/.sync.yml +++ b/.sync.yml @@ -2,11 +2,11 @@ .github/workflows/ci.yaml: acceptance_matrix: set: - - el7 + - ---el7 - el8 - el9 - - debian-10 - - ubuntu-2004 + # Repos are currently broken + - ---ubuntu-2004 puppet: - puppet7 - puppet8 @@ -19,8 +19,12 @@ Gemfile: ':development': - gem: rspec-json_expectations - gem: webrick +spec/acceptance/nodesets/el7.yml: + delete: true spec/acceptance/nodesets/debian-11.yml: delete: true +spec/acceptance/nodesets/debian-12.yml: + delete: true spec/acceptance/nodesets/ubuntu-2204.yml: delete: true spec/spec_helper.rb: diff --git a/Gemfile b/Gemfile index c4c19ce..a79e1d5 100644 --- a/Gemfile +++ b/Gemfile @@ -17,7 +17,7 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments minor_version = ruby_version_segments[0..1].join('.') group :development do - gem "voxpupuli-test", '5.4.1', require: false + gem "voxpupuli-test", '7.0.0', require: false gem "rspec-json_expectations", require: false gem "webrick", require: false gem "faraday", '~> 1.0', require: false @@ -31,8 +31,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/manifests/init.pp b/manifests/init.pp index ad7e6ec..a158570 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -53,7 +53,7 @@ class perfsonar ( Boolean $manage_repo = true, Boolean $manage_epel = true, - Variant[Stdlib::HTTPUrl,Stdlib::HTTPSUrl] $release_url = "http://software.internet2.edu/rpms/el${facts['os']['release']['major']}/x86_64/latest/packages/perfsonar-repo-0.11-1.noarch.rpm", + Variant[Stdlib::HTTPUrl,Stdlib::HTTPSUrl] $release_url = "https://software.internet2.edu/rpms/el${facts['os']['release']['major']}/x86_64/latest/packages/perfsonar-repo-0.11-1.noarch.rpm", Enum['perfsonar-tools','perfsonar-testpoint','perfsonar-core','perfsonar-centralmanagement','perfsonar-toolkit'] $bundle = 'perfsonar-toolkit', Array $optional_packages = [], diff --git a/manifests/repo.pp b/manifests/repo.pp index 6337c8f..020cabc 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -7,17 +7,15 @@ if $perfsonar::manage_epel { contain 'epel' } - if versioncmp($facts['os']['release']['major'], '8') >= 0 { - $gpgkey_path = '/etc/pki/rpm-gpg/RPM-GPG-KEY-perfSONAR' - $gpgkey = "file://${gpgkey_path}" - exec { 'RPM-GPG-KEY-Globus': - path => '/usr/bin:/bin:/usr/sbin:/sbin', - command => "wget -qO- ${perfsonar::release_url} | rpm2cpio - | cpio -i --quiet --to-stdout .${gpgkey_path} > ${gpgkey_path}", - creates => $gpgkey_path, - before => Yumrepo['perfSONAR'], - } - } else { - $gpgkey = 'http://software.internet2.edu/rpms/RPM-GPG-KEY-perfSONAR' + $gpgkey_path = '/etc/pki/rpm-gpg/RPM-GPG-KEY-perfSONAR' + $gpgkey = "file://${gpgkey_path}" + # Extract GPG key from release RPM as the GPG keys on website don't match + # what is used to sign the RPMs + exec { 'RPM-GPG-KEY-perfSONAR': + path => '/usr/bin:/bin:/usr/sbin:/sbin', + command => "wget -qO- ${perfsonar::release_url} | rpm2cpio - | cpio -i --quiet --to-stdout .${gpgkey_path} > ${gpgkey_path}", + creates => $gpgkey_path, + before => Yumrepo['perfSONAR'], } yumrepo { 'perfSONAR': descr => 'perfSONAR RPM Repository - software.internet2.edu - main', @@ -40,7 +38,7 @@ }, key => { 'id' => '5A507954F531B92300DA2068351ED8279AFA4E0A', - 'source' => 'http://downloads.perfsonar.net/debian/perfsonar-debian-official.gpg.key', + 'source' => 'http://downloads.perfsonar.net/debian/perfsonar-official.gpg.key', }, } } diff --git a/metadata.json b/metadata.json index 21302f4..a5795df 100644 --- a/metadata.json +++ b/metadata.json @@ -34,16 +34,9 @@ } ], "operatingsystem_support": [ - { - "operatingsystem": "CentOS", - "operatingsystemrelease": [ - "7" - ] - }, { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "7", "8", "9" ] @@ -62,12 +55,6 @@ "9" ] }, - { - "operatingsystem": "Debian", - "operatingsystemrelease": [ - "10" - ] - }, { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ @@ -83,5 +70,5 @@ ], "pdk-version": "2.7.1", "template-url": "https://github.com/treydock/pdk-templates.git#master", - "template-ref": "heads/master-0-gced7f95" + "template-ref": "heads/master-0-g5a59870" } diff --git a/spec/acceptance/nodesets/debian-10.yml b/spec/acceptance/nodesets/debian-10.yml deleted file mode 100644 index 7cc9f66..0000000 --- a/spec/acceptance/nodesets/debian-10.yml +++ /dev/null @@ -1,28 +0,0 @@ -HOSTS: - debian10: - roles: - - agent - platform: debian-10-amd64 - hypervisor: docker - image: debian:10 - docker_preserve_image: true - docker_cmd: - - '/sbin/init' - docker_image_commands: - - 'apt-get install -y wget net-tools systemd-sysv locales apt-transport-https ca-certificates' - - 'echo "LC_ALL=en_US.UTF-8" >> /etc/environment' - - 'echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen' - - 'echo "LANG=en_US.UTF-8" > /etc/locale.conf' - - '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: 'perfsonar-debian10' -CONFIG: - log_level: debug - type: foss -ssh: - password: root - auth_methods: ["password"] - diff --git a/spec/acceptance/nodesets/el7.yml b/spec/acceptance/nodesets/el7.yml deleted file mode 100644 index 7c2126e..0000000 --- a/spec/acceptance/nodesets/el7.yml +++ /dev/null @@ -1,26 +0,0 @@ -HOSTS: - centos-7: - roles: - - agent - platform: el-7-x86_64 - hypervisor: docker - image: centos:7 - docker_preserve_image: true - docker_cmd: - - '/usr/sbin/init' - docker_image_commands: - - 'yum install -y wget which cronie iproute initscripts' - - 'wget --no-check-certificate https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7/repo/epel-7/jsynacek-systemd-backports-for-centos-7-epel-7.repo -O /etc/yum.repos.d/jsynacek-systemd-centos-7.repo' - - 'yum update -y systemd' - docker_env: - - LANG=en_US.UTF-8 - - LANGUAGE=en_US.UTF-8 - - LC_ALL=en_US.UTF-8 - docker_container_name: 'perfsonar-el7' -CONFIG: - log_level: debug - type: foss -ssh: - password: root - auth_methods: ["password"] - diff --git a/spec/classes/perfsonar_spec.rb b/spec/classes/perfsonar_spec.rb index 75c7045..80c0ce5 100644 --- a/spec/classes/perfsonar_spec.rb +++ b/spec/classes/perfsonar_spec.rb @@ -4,7 +4,7 @@ describe 'perfsonar' do on_supported_os.each do |os, os_facts| - context "on #{os}" do + context "when #{os}" do let(:facts) { os_facts } it { is_expected.to compile } diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index d0d3a82..09cf9fa 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 ENV['BEAKER_set'] == 'debian-12' +on hosts, 'apt install -y puppet-agent' if ENV['BEAKER_set'] == 'debian-12' 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 deleted file mode 100644 index 9baa7b2..0000000 --- a/spec/spec_helper_acceptance_setup.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -hiera_yaml = <<-HIERA ---- -version: 5 -defaults: - datadir: data - data_hash: yaml_data -hierarchy: - - name: 'os family' - path: "os/%{facts.os.family}.yaml" - - name: "Common" - path: "common.yaml" -HIERA -debian_yaml = <<-HIERA ---- -perfsonar::bundle: perfsonar-testpoint -HIERA - -create_remote_file(hosts, '/etc/puppetlabs/puppet/hiera.yaml', hiera_yaml) -on hosts, 'mkdir -p /etc/puppetlabs/puppet/data/os' -create_remote_file(hosts, '/etc/puppetlabs/puppet/data/os/Debian.yaml', debian_yaml)