Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Debian 8, Debian 9 and RedHat 6 (EOL) #16

Merged
merged 7 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
spec/spec_helper_acceptance.rb:
unmanaged: false
4 changes: 2 additions & 2 deletions manifests/hiera/create_resources.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
$varname = "${riemann::hiera::prefix}${rsname}"
create_resources (
$rsname,
hiera_hash(
lookup(
$varname,
{}
{ default_value => {} }
)
)
}
14 changes: 6 additions & 8 deletions manifests/let.pp
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#
define riemann::let (
$content = $title,
$streams = 'default',
Variant[Array[String[1]],Hash[String[1], String[1]],String[1]] $content = $title,
String[1] $streams = 'default',
)
{
if (is_array($content)) {
$content_string = join(flatten($content), ' ')
} elsif (is_hash($content)) {
$content_string = join(sort(join_keys_to_values($content, ' ')),' ')
} else {
$content_string = $content
$content_string = $content ? {
Array => join(flatten($content), ' '),
Hash => join(sort(join_keys_to_values($content, ' ')),' '),
String => $content,
}
include riemann
if !defined(Riemann::Streams[$streams]) {
Expand Down
20 changes: 8 additions & 12 deletions manifests/streams.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# and construct its contents using riemann::stream defines
#
define riemann::streams (
$let = [],
$order = "50-${title}",
$header = '(streams',
$footer = ')',
Variant[Array[String[1]], Hash[String[1], String[1]], String[1]] $let = [],
String[1] $order = "50-${title}",
String[1] $header = '(streams',
String[1] $footer = ')',
)
{
include riemann
Expand All @@ -18,14 +18,10 @@
order => "${order}-00",
}
# let items given as params
if (is_array($let)) {
$let_body = join($let,' ')
} elsif (is_hash($let)) {
$let_body = join(sort(join_keys_to_values($let,' ')),' ')
} elsif (is_string($let)) {
$let_body = $let
} else {
fail("streams: 'let' must be array, hash or string")
$let_body = $let ? {
Array => join($let,' '),
Hash => join(sort(join_keys_to_values($let,' ')),' '),
default => $let,
}
riemann::config::fragment { "let ${title} body":
content => " ${let_body}",
Expand Down
15 changes: 6 additions & 9 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@
},
{
"name": "puppetlabs/concat",
"version_requirement": ">= 1.1.1 < 8.0.0"
"version_requirement": ">= 1.1.1 < 10.0.0"
}
],
"operatingsystem_support": [
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8.0",
"9.0",
"10.0",
"11.0"
"10",
"11"
]
},
{
Expand All @@ -33,16 +31,15 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"6.0",
"7.0",
"8.0"
"7",
"8"
]
}
],
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.9.0 < 8.0.0"
"version_requirement": ">= 7.0.0 < 8.0.0"
}
]
}
21 changes: 21 additions & 0 deletions spec/setup_acceptance_node.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
case $facts.get('os.family') {
debian: {
package { 'openjdk-11-jre-headless':
ensure => installed,
}

file { '/tmp/riemann_0.3.8_all.deb':
ensure => file,
source => 'https://github.com/riemann/riemann/releases/download/0.3.8/riemann_0.3.8_all.deb',
}

package { 'riemann':
ensure => installed,
provider => 'dpkg',
source => '/tmp/riemann_0.3.8_all.deb',
}
}
default: {
fail('The test suite assume riemann is available in the package manager')
}
}
21 changes: 5 additions & 16 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
# frozen_string_literal: true

require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

RSpec.configure do |c|
# Project root
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
require 'voxpupuli/acceptance/spec_helper_acceptance'

# Readable test descriptions
c.formatter = :documentation
configure_beaker

# Configure all nodes in nodeset
c.before :suite do
# Install module and dependencies
puppet_module_install(source: proj_root, module_name: 'riemann')
hosts.each do |host|
on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0, 1]
end
end
end
Dir['./spec/support/acceptance/**/*.rb'].sort.each { |f| require f }