Skip to content

Commit 0e8cada

Browse files
authored
Merge branch 'voxpupuli:master' into api_providers
2 parents 3548c8c + a122643 commit 0e8cada

15 files changed

+51
-129
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/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,

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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": [

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'

spec/classes/server_spec.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@
1313
next if facts[:os]['name'] == 'windows'
1414

1515
context "on #{os}" do
16-
systemd_fact = case facts[:osfamily]
17-
when 'Archlinux', 'Fedora', 'Gentoo'
18-
{ systemd: true }
19-
else
20-
{ systemd: false }
21-
end
22-
let :facts do
23-
facts.merge(systemd_fact)
24-
end
16+
let(:facts) { facts }
2517

2618
zabbix_version = '5.0'
2719

@@ -155,7 +147,7 @@
155147

156148
context 'it creates a startup script' do
157149
case facts[:osfamily]
158-
when 'Archlinux', 'Fedora', 'Gentoo'
150+
when 'Archlinux', 'Debian', 'Gentoo', 'RedHat'
159151
it { is_expected.to contain_file('/etc/init.d/zabbix-server').with_ensure('absent') }
160152
it { is_expected.to contain_file('/etc/systemd/system/zabbix-server.service').with_ensure('file') }
161153
else

0 commit comments

Comments
 (0)