Skip to content

Commit e6b031f

Browse files
authored
Merge branch 'voxpupuli:master' into master
2 parents 6e297b2 + a122643 commit e6b031f

27 files changed

+70
-226
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -7,86 +7,12 @@ name: CI
77
on: pull_request
88

99
concurrency:
10-
group: ${{ github.head_ref }}
10+
group: ${{ github.ref_name }}
1111
cancel-in-progress: true
1212

1313
jobs:
14-
setup_matrix:
15-
name: 'Setup Test Matrix'
16-
runs-on: ubuntu-latest
17-
timeout-minutes: 40
18-
outputs:
19-
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
20-
github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
21-
env:
22-
BUNDLE_WITHOUT: development:system_tests:release
23-
steps:
24-
- uses: actions/checkout@v2
25-
- name: Setup ruby
26-
uses: ruby/setup-ruby@v1
27-
with:
28-
ruby-version: '3.0'
29-
bundler-cache: true
30-
- name: Run static validations
31-
run: bundle exec rake validate lint check
32-
- name: Run rake rubocop
33-
run: bundle exec rake rubocop
34-
- name: Setup Test Matrix
35-
id: get-outputs
36-
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround CentOS,Ubuntu
37-
38-
unit:
39-
needs: setup_matrix
40-
runs-on: ubuntu-latest
41-
timeout-minutes: 40
42-
strategy:
43-
fail-fast: false
44-
matrix:
45-
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
46-
env:
47-
BUNDLE_WITHOUT: development:system_tests:release
48-
PUPPET_VERSION: "~> ${{ matrix.puppet }}.0"
49-
name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
50-
steps:
51-
- uses: actions/checkout@v2
52-
- name: Setup ruby
53-
uses: ruby/setup-ruby@v1
54-
with:
55-
ruby-version: ${{ matrix.ruby }}
56-
bundler-cache: true
57-
- name: Run tests
58-
run: bundle exec rake parallel_spec
59-
60-
acceptance:
61-
needs: setup_matrix
62-
runs-on: ubuntu-latest
63-
env:
64-
LANG: en_US
65-
LC_ALL: en_US.UTF-8
66-
BUNDLE_WITHOUT: development:test:release
67-
strategy:
68-
fail-fast: false
69-
matrix:
70-
include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
71-
name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
72-
steps:
73-
- uses: actions/checkout@v2
74-
- name: Setup ruby
75-
uses: ruby/setup-ruby@v1
76-
with:
77-
ruby-version: '3.0'
78-
bundler-cache: true
79-
- name: Run tests
80-
run: bundle exec rake beaker
81-
env:
82-
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
83-
BEAKER_setfile: ${{ matrix.setfile.value }}
84-
85-
tests:
86-
needs:
87-
- unit
88-
- acceptance
89-
runs-on: ubuntu-latest
90-
name: Test suite
91-
steps:
92-
- run: echo Test suite completed
14+
puppet:
15+
name: Puppet
16+
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
17+
with:
18+
pidfile_workaround: 'CentOS,Ubuntu'

.msync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Managed by modulesync - DO NOT EDIT
33
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
44

5-
modulesync_config_version: '5.2.0'
5+
modulesync_config_version: '5.3.0'

.rubocop.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
---
2-
inherit_from: .rubocop_todo.yml
3-
42
# Managed by modulesync - DO NOT EDIT
53
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
64

5+
inherit_from: .rubocop_todo.yml
76
inherit_gem:
87
voxpupuli-test: rubocop.yml

.sync.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ spec/spec_helper.rb:
99
spec_overrides:
1010
- "require 'support/acceptance/supported_versions'"
1111
- "require 'spec_helper_methods'"
12-
spec/spec_helper_acceptance.rb:
13-
unmanaged: false
1412
.github/workflows/ci.yml:
1513
pidfile_workaround: CentOS,Ubuntu
1614
.puppet-lint.rc:

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
55

66
group :test do
7-
gem 'voxpupuli-test', '~> 5.0', :require => false
7+
gem 'voxpupuli-test', '~> 5.4', :require => false
88
gem 'coveralls', :require => false
99
gem 'simplecov-console', :require => false
1010
gem 'puppet_metadata', '~> 1.0', :require => false

REFERENCE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,6 +2505,8 @@ The following parameters are available in the `zabbix::proxy` class:
25052505
* [`database_password`](#database_password)
25062506
* [`database_socket`](#database_socket)
25072507
* [`database_port`](#database_port)
2508+
* [`database_charset`](#database_collate)
2509+
* [`database_collate`](#database_collate)
25082510
* [`database_tlsconnect`](#database_tlsconnect)
25092511
* [`database_tlscafile`](#database_tlscafile)
25102512
* [`database_tlscertfile`](#database_tlscertfile)
@@ -2874,6 +2876,22 @@ Database port when not using local socket. Ignored for sqlite.
28742876

28752877
Default value: `$zabbix::params::proxy_database_port`
28762878

2879+
##### <a name="database_charset"></a>`database_charset`
2880+
2881+
Data type: `Any`
2882+
2883+
The default charset of the database.
2884+
2885+
Default value: `$zabbix::params::server_database_charset`
2886+
2887+
##### <a name="database_collate"></a>`database_collate`
2888+
2889+
Data type: `Any`
2890+
2891+
The default collation of the database.
2892+
2893+
Default value: `$zabbix::params::server_database_collate`
2894+
28772895
##### <a name="database_tlsconnect"></a>`database_tlsconnect`
28782896

28792897
Data type: `Optional[Enum['required', 'verify_ca', 'verify_full']]`

manifests/init.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@
236236
$apache_ssl_cipher = $zabbix::params::apache_ssl_cipher,
237237
$apache_ssl_chain = $zabbix::params::apache_ssl_chain,
238238
$apache_listen_ip = $zabbix::params::apache_listen_ip,
239-
$apache_listenport = $zabbix::params::apache_listenport,
240-
$apache_listenport_ssl = $zabbix::params::apache_listenport_ssl,
239+
Variant[Array[Stdlib::Port], Stdlib::Port] $apache_listenport = $zabbix::params::apache_listenport,
240+
Variant[Array[Stdlib::Port], Stdlib::Port] $apache_listenport_ssl = $zabbix::params::apache_listenport_ssl,
241241
$apache_php_max_execution_time = $zabbix::params::apache_php_max_execution_time,
242242
$apache_php_memory_limit = $zabbix::params::apache_php_memory_limit,
243243
$apache_php_post_max_size = $zabbix::params::apache_php_post_max_size,

manifests/params.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@
169169

170170
# Zabbix-web
171171
$apache_listen_ip = undef
172-
$apache_listenport = '80'
173-
$apache_listenport_ssl = '443'
172+
$apache_listenport = 80
173+
$apache_listenport_ssl = 443
174174
$apache_ssl_cert = undef
175175
$apache_ssl_chain = undef
176176
# Cipher is used from: https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility

manifests/proxy.pp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
# @param database_password Database password. ignored for sqlite.
4444
# @param database_socket Path to mysql socket.
4545
# @param database_port Database port when not using local socket. Ignored for sqlite.
46+
# @param database_charset The default charset of the database.
47+
# @param database_collate The default collation of the database.
4648
# @param database_tlsconnect
4749
# Available options:
4850
# * required - connect using TLS
@@ -220,6 +222,8 @@
220222
$database_password = $zabbix::params::proxy_database_password,
221223
$database_socket = $zabbix::params::proxy_database_socket,
222224
$database_port = $zabbix::params::proxy_database_port,
225+
$database_charset = $zabbix::params::server_database_charset,
226+
$database_collate = $zabbix::params::server_database_collate,
223227
Optional[Enum['required', 'verify_ca', 'verify_full']] $database_tlsconnect = $zabbix::params::proxy_database_tlsconnect,
224228
Optional[Stdlib::Absolutepath] $database_tlscafile = $zabbix::params::proxy_database_tlscafile,
225229
Optional[Stdlib::Absolutepath] $database_tlscertfile = $zabbix::params::proxy_database_tlscertfile,
@@ -487,6 +491,8 @@
487491
database_user => $database_user,
488492
database_password => $database_password,
489493
database_host => $database_host,
494+
database_charset => $database_charset,
495+
database_collate => $database_collate,
490496
zabbix_proxy => $zabbix_proxy,
491497
zabbix_proxy_ip => $zabbix_proxy_ip,
492498
before => $before_database,

manifests/web.pp

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@
110110
$apache_ssl_cipher = $zabbix::params::apache_ssl_cipher,
111111
$apache_ssl_chain = $zabbix::params::apache_ssl_chain,
112112
$apache_listen_ip = $zabbix::params::apache_listen_ip,
113-
$apache_listenport = $zabbix::params::apache_listenport,
114-
$apache_listenport_ssl = $zabbix::params::apache_listenport_ssl,
113+
Variant[Array[Stdlib::Port], Stdlib::Port] $apache_listenport = $zabbix::params::apache_listenport,
114+
Variant[Array[Stdlib::Port], Stdlib::Port] $apache_listenport_ssl = $zabbix::params::apache_listenport_ssl,
115115
$zabbix_api_user = $zabbix::params::server_api_user,
116116
$zabbix_api_pass = $zabbix::params::server_api_pass,
117117
$database_host = $zabbix::params::server_database_host,
@@ -151,7 +151,7 @@
151151
# zabbix frontend 5.x is not supported, among others, on stretch and xenial.
152152
# https://www.zabbix.com/documentation/current/manual/installation/frontend/frontend_on_debian
153153
if $facts['os']['name'] in ['ubuntu', 'debian'] and versioncmp($zabbix_version, '5') >= 0 {
154-
if versioncmp($facts['os']['release']['major'], '16.04') == 0 or versioncmp($facts['os']['release']['major'], '9') == 0 {
154+
if versioncmp($facts['os']['release']['major'], '9') == 0 {
155155
fail("${facts['os']['family']} ${$facts['os']['release']['major']} is not supported for zabbix::web")
156156
}
157157
}
@@ -227,29 +227,7 @@
227227
case $facts['os']['name'] {
228228
'ubuntu', 'debian': {
229229
$zabbix_web_package = 'zabbix-frontend-php'
230-
231-
# Check OS release for proper prefix
232-
case $facts['os']['name'] {
233-
'Ubuntu': {
234-
if versioncmp($facts['os']['release']['major'], '16.04') >= 0 {
235-
$php_db_package = "php-${db}"
236-
}
237-
else {
238-
$php_db_package = "php5-${db}"
239-
}
240-
}
241-
'Debian': {
242-
if versioncmp($facts['os']['release']['major'], '9') >= 0 {
243-
$php_db_package = "php-${db}"
244-
}
245-
else {
246-
$php_db_package = "php5-${db}"
247-
}
248-
}
249-
default: {
250-
$php_db_package = "php5-${db}"
251-
}
252-
}
230+
$php_db_package = "php-${db}"
253231

254232
package { $php_db_package:
255233
ensure => $zabbix_package_state,

metadata.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
{
2020
"name": "puppetlabs/apache",
21-
"version_requirement": ">= 1.6.0 < 7.0.0"
21+
"version_requirement": ">= 8.0.0 < 9.0.0"
2222
},
2323
{
2424
"name": "puppetlabs/firewall",
@@ -52,7 +52,7 @@
5252
"requirements": [
5353
{
5454
"name": "puppet",
55-
"version_requirement": ">= 6.1.0 < 8.0.0"
55+
"version_requirement": ">= 7.0.0 < 8.0.0"
5656
}
5757
],
5858
"operatingsystem_support": [
@@ -107,15 +107,13 @@
107107
{
108108
"operatingsystem": "Ubuntu",
109109
"operatingsystemrelease": [
110-
"16.04",
111110
"18.04",
112111
"20.04"
113112
]
114113
},
115114
{
116115
"operatingsystem": "Debian",
117116
"operatingsystemrelease": [
118-
"9",
119117
"10",
120118
"11"
121119
]

spec/acceptance/server_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
require 'spec_helper_acceptance'
4-
describe 'zabbix::server class' do
4+
describe 'zabbix::server class', unless: default[:platform] =~ %r{archlinux} do
55
context 'default parameters' do
66
# Using puppet_apply as a helper
77
it 'works idempotently with no errors' do

spec/acceptance/zabbix_application_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'spec_helper_acceptance'
44
require 'serverspec_type_zabbixapi'
55

6-
describe 'zabbix_application type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
6+
describe 'zabbix_application type', unless: default[:platform] =~ %r{archlinux} do
77
supported_versions.each do |zabbix_version|
88
# 5.2 and 5.4 server packages are not available for RHEL 7
99
next if zabbix_version == '5.2' && default[:platform] == 'el-7-x86_64'

spec/acceptance/zabbix_host_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require 'serverspec_type_zabbixapi'
55

66
# rubocop:disable RSpec/LetBeforeExamples
7-
describe 'zabbix_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
7+
describe 'zabbix_host type', unless: default[:platform] =~ %r{archlinux} do
88
supported_versions.each do |zabbix_version|
99
# >= 5.2 server packages are not available for RHEL 7
1010
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'

spec/acceptance/zabbix_hostgroup_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'spec_helper_acceptance'
44
require 'serverspec_type_zabbixapi'
55

6-
describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
6+
describe 'zabbix_hostgroup type', unless: default[:platform] =~ %r{archlinux} do
77
supported_versions.each do |zabbix_version|
88
# >= 5.2 server packages are not available for RHEL 7
99
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'

spec/acceptance/zabbix_proxy_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
require 'serverspec_type_zabbixapi'
55

66
# rubocop:disable RSpec/LetBeforeExamples
7-
describe 'zabbix_proxy type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
7+
describe 'zabbix_proxy type', unless: default[:platform] =~ %r{archlinux} do
88
supported_versions.each do |zabbix_version|
99
# >= 5.2 server packages are not available for RHEL 7
1010
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'

spec/acceptance/zabbix_template_host_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'spec_helper_acceptance'
44
require 'serverspec_type_zabbixapi'
55

6-
describe 'zabbix_template_host type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
6+
describe 'zabbix_template_host type', unless: default[:platform] =~ %r{archlinux} do
77
supported_versions.each do |zabbix_version|
88
# Zabbix 6.0 removed the ability to attach templates directly to hosts.
99
next if zabbix_version == '6.0'

spec/acceptance/zabbix_template_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'spec_helper_acceptance'
44
require 'serverspec_type_zabbixapi'
55

6-
describe 'zabbix_template type', unless: default[:platform] =~ %r{(ubuntu-16.04|debian-9)-amd64} do
6+
describe 'zabbix_template type', unless: default[:platform] =~ %r{archlinux} do
77
supported_versions.each do |zabbix_version|
88
# >= 5.2 server packages are not available for RHEL 7
99
next if zabbix_version >= '5.2' && default[:platform] == 'el-7-x86_64'

spec/classes/agent_spec.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@
1616

1717
on_supported_os(baseline_os_hash).each do |os, facts|
1818
context "on #{os}" do
19-
systemd_fact = case facts[:osfamily]
20-
when 'Archlinux', 'Fedora', 'Gentoo'
21-
{ systemd: true }
22-
else
23-
{ systemd: false }
24-
end
2519
config_path = case facts[:operatingsystem]
2620
when 'Fedora'
2721
'/etc/zabbix_agentd.conf'
@@ -45,9 +39,7 @@
4539
end
4640
zabbix_version = '5.0'
4741

48-
let :facts do
49-
facts.merge(systemd_fact)
50-
end
42+
let(:facts) { facts }
5143

5244
case facts[:osfamily]
5345
when 'Gentoo'
@@ -221,7 +213,7 @@
221213
context 'it creates a startup script' do
222214
if facts[:kernel] == 'Linux'
223215
case facts[:osfamily]
224-
when 'Archlinux', 'Fedora', 'Gentoo'
216+
when 'Archlinux', 'Debian', 'Gentoo', 'RedHat'
225217
it { is_expected.to contain_file("/etc/init.d/#{service_name}").with_ensure('absent') }
226218
it { is_expected.to contain_file("/etc/systemd/system/#{service_name}.service").with_ensure('file') }
227219
when 'windows'

0 commit comments

Comments
 (0)