Showing with 684 additions and 1,676 deletions.
  1. +13 −3 .github/CONTRIBUTING.md
  2. +3 −0 .github/labeler.yml
  3. +11 −12 .github/workflows/ci.yml
  4. +2 −0 .gitignore
  5. +1 −1 .msync.yml
  6. +5 −3 .overcommit.yml
  7. +0 −5 .rspec
  8. +0 −4 .rspec_parallel
  9. +1 −2 .rubocop.yml
  10. +29 −0 CHANGELOG.md
  11. +0 −24 Dockerfile
  12. +2 −2 Gemfile
  13. +22 −176 README.md
  14. +47 −58 REFERENCE.md
  15. +11 −4 data/Archlinux.yaml
  16. +6 −6 data/defaults.yaml
  17. +2 −10 manifests/alertmanager.pp
  18. +11 −25 manifests/alerts.pp
  19. +72 −137 manifests/config.pp
  20. +19 −3 manifests/daemon.pp
  21. +15 −20 manifests/init.pp
  22. +2 −0 manifests/ipmi_exporter.pp
  23. +1 −1 manifests/mysqld_exporter.pp
  24. +2 −1 manifests/rabbitmq_exporter.pp
  25. +1 −38 manifests/redis_exporter.pp
  26. +5 −8 manifests/server.pp
  27. +2 −6 metadata.json
  28. +1 −17 spec/acceptance/alertmanager_spec.rb
  29. +9 −4 spec/acceptance/node_exporter_spec.rb
  30. +1 −1 spec/acceptance/postfix_exporter_spec.rb
  31. +2 −2 spec/acceptance/prometheus_server_spec.rb
  32. +1 −1 spec/acceptance/rabbitmq_exporter_spec.rb
  33. +0 −26 spec/acceptance/redis_exporter_spec.rb
  34. +6 −14 spec/classes/alertmanager_spec.rb
  35. +4 −16 spec/classes/apache_exporter_spec.rb
  36. +4 −10 spec/classes/dellhw_exporter_spec.rb
  37. +14 −11 spec/classes/ipmi_exporter_spec.rb
  38. +7 −5 spec/classes/memcached_exporter_spec.rb
  39. +4 −4 spec/classes/mysqld_exporter_spec.rb
  40. +4 −16 spec/classes/nginx_prometheus_exporter_spec.rb
  41. +1 −4 spec/classes/node_exporter_spec.rb
  42. +4 −16 spec/classes/php_fpm_exporter_spec.rb
  43. +80 −142 spec/classes/prometheus_spec.rb
  44. +4 −10 spec/classes/puppetdb_exporter_spec.rb
  45. +15 −0 spec/classes/rabbitmq_exporter_spec.rb
  46. +3 −4 spec/classes/redis_exporter_spec.rb
  47. +1 −1 spec/classes/server_spec.rb
  48. +1 −17 spec/defines/alerts_spec.rb
  49. +12 −12 spec/defines/daemon_spec.rb
  50. +0 −50 spec/fixtures/files/cli/prometheus1_all.systemd
  51. +0 −36 spec/fixtures/files/cli/prometheus1_extra.systemd
  52. +10 −12 spec/fixtures/files/cli/prometheus2_6_retention.systemd
  53. +10 −41 spec/fixtures/files/cli/prometheus2_all.systemd
  54. +10 −13 spec/fixtures/files/cli/prometheus2_extra.systemd
  55. +0 −9 spec/fixtures/files/prometheus1.alert.rules
  56. +0 −178 spec/fixtures/files/prometheus1.debian
  57. +0 −34 spec/fixtures/files/prometheus1.systemd
  58. +0 −130 spec/fixtures/files/prometheus1.sysv
  59. +0 −35 spec/fixtures/files/prometheus1.upstart
  60. +0 −20 spec/fixtures/files/prometheus1.yaml
  61. +102 −105 spec/fixtures/files/prometheus2.debian
  62. +10 −12 spec/fixtures/files/prometheus2.systemd
  63. +72 −72 spec/fixtures/files/prometheus2.sysv
  64. +1 −1 spec/fixtures/files/prometheus2.upstart
  65. +1 −8 spec/setup_acceptance_node.pp
  66. +0 −23 templates/daemon.systemd.erb
  67. +4 −4 templates/prometheus.systemd.epp
  68. +1 −11 templates/prometheus.yaml.erb
16 changes: 13 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,29 @@ You can install all needed gems for spec tests into the modules directory by
running:

```sh
bundle install --path .vendor/ --without development system_tests release --jobs "$(nproc)"
bundle config set --local path '.vendor/'
bundle config set --local without 'development system_tests release'
bundle install --jobs "$(nproc)"
```

If you also want to run acceptance tests:

```sh
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"
bundle config set --local path '.vendor/'
bundle config set --local without 'development release'
bundle config set --local with 'system_tests'
bundle install --jobs "$(nproc)"
```

Our all in one solution if you don't know if you need to install or update gems:

```sh
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"; bundle update; bundle clean
bundle config set --local path '.vendor/'
bundle config set --local without 'development release'
bundle config set --local with 'system_tests'
bundle install --jobs "$(nproc)"
bundle update
bundle clean
```

As an alternative to the `--jobs "$(nproc)` parameter, you can set an
Expand Down
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
skip-changelog:
- head-branch: ['^release-*', 'release']
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@ jobs:
timeout-minutes: 40
outputs:
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
puppet_beaker_test_matrix: ${{ steps.get-outputs.outputs.puppet_beaker_test_matrix }}
env:
BUNDLE_WITHOUT: development:system_tests:release
PUPPET_GEM_VERSION: ">= 7.0"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
ruby-version: '3.3'
bundler-cache: true
- name: Run static validations
run: bundle exec rake validate lint check
- name: Run rake rubocop
run: bundle exec rake rubocop
- name: Setup Test Matrix
id: get-outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false
run: bundle exec metadata2gha --pidfile-workaround false --domain example.com

unit:
needs: setup_matrix
Expand All @@ -45,7 +46,7 @@ jobs:
PUPPET_VERSION: "~> ${{ matrix.puppet }}.0"
name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
Expand All @@ -62,22 +63,20 @@ jobs:
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
include: ${{fromJson(needs.setup_matrix.outputs.puppet_beaker_test_matrix)}}
name: "${{ matrix.name }}"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
ruby-version: '3.3'
bundler-cache: true
- name: Start squid
run: ./scripts/start-squid.sh
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}
env: ${{ matrix.env }}
- name: squid logs
run: docker logs squid --tail 50
if: always()
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
.*.sw?
/.yardoc/
/Guardfile
bolt-debug.log
.rerun.json
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '7.3.0'
modulesync_config_version: '9.0.0'
8 changes: 5 additions & 3 deletions .overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ PreCommit:
enabled: true
description: 'Runs rubocop on modified files only'
command: ['bundle', 'exec', 'rubocop']
PuppetLint:
RakeTarget:
enabled: true
description: 'Runs puppet-lint on modified files only'
command: ['bundle', 'exec', 'puppet-lint']
description: 'Runs lint on modified files only'
targets:
- 'lint'
command: ['bundle', 'exec', 'rake']
YamlSyntax:
enabled: true
JsonSyntax:
Expand Down
5 changes: 0 additions & 5 deletions .rspec

This file was deleted.

4 changes: 0 additions & 4 deletions .rspec_parallel

This file was deleted.

3 changes: 1 addition & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
inherit_from: .rubocop_todo.yml

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

inherit_from: .rubocop_todo.yml
inherit_gem:
voxpupuli-test: rubocop.yml
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v15.0.0](https://github.com/voxpupuli/puppet-prometheus/tree/v15.0.0) (2024-06-13)

[Full Changelog](https://github.com/voxpupuli/puppet-prometheus/compare/v14.0.0...v15.0.0)

**Breaking changes:**

- Remove support for alertmanager \< 0.13.0 [\#720](https://github.com/voxpupuli/puppet-prometheus/issues/720)
- Remove prometheus 1.x support [\#718](https://github.com/voxpupuli/puppet-prometheus/issues/718)
- drop suport for redis\_exporter \< 1.0.0 [\#732](https://github.com/voxpupuli/puppet-prometheus/pull/732) ([TheMeier](https://github.com/TheMeier))
- drop support for alertmanager \< 0.13.0 [\#731](https://github.com/voxpupuli/puppet-prometheus/pull/731) ([TheMeier](https://github.com/TheMeier))
- drop support for prometheus 1.x, update prometheus version to 2.52.0 [\#728](https://github.com/voxpupuli/puppet-prometheus/pull/728) ([TheMeier](https://github.com/TheMeier))
- drop Debian 10 support [\#727](https://github.com/voxpupuli/puppet-prometheus/pull/727) ([TheMeier](https://github.com/TheMeier))
- drop RedHat and CentOS 7 & 8 support [\#726](https://github.com/voxpupuli/puppet-prometheus/pull/726) ([TheMeier](https://github.com/TheMeier))
- update alertmanager to 0.21.0-\>0.27.0 [\#725](https://github.com/voxpupuli/puppet-prometheus/pull/725) ([TheMeier](https://github.com/TheMeier))
- Change default port from 9090 to 9419 [\#637](https://github.com/voxpupuli/puppet-prometheus/pull/637) ([mindriot88](https://github.com/mindriot88))

**Implemented enhancements:**

- deprecation of `source_match(_re)` and `target_match(_re)` [\#697](https://github.com/voxpupuli/puppet-prometheus/issues/697)
- replace templates for systemd units with systemd::manage\_unit [\#735](https://github.com/voxpupuli/puppet-prometheus/pull/735) ([TheMeier](https://github.com/TheMeier))
- remove code for puppet \< 7 [\#724](https://github.com/voxpupuli/puppet-prometheus/pull/724) ([TheMeier](https://github.com/TheMeier))
- Fix Archlinux acceptance test [\#719](https://github.com/voxpupuli/puppet-prometheus/pull/719) ([TheMeier](https://github.com/TheMeier))
- update puppet-systemd upper bound to 8.0.0 [\#716](https://github.com/voxpupuli/puppet-prometheus/pull/716) ([TheMeier](https://github.com/TheMeier))

**Fixed bugs:**

- fix syntax of altermanager::receivers [\#723](https://github.com/voxpupuli/puppet-prometheus/pull/723) ([TheMeier](https://github.com/TheMeier))
- change path or my.cnf for mysqld\_exporter [\#722](https://github.com/voxpupuli/puppet-prometheus/pull/722) ([TheMeier](https://github.com/TheMeier))

## [v14.0.0](https://github.com/voxpupuli/puppet-prometheus/tree/v14.0.0) (2024-03-26)

[Full Changelog](https://github.com/voxpupuli/puppet-prometheus/compare/v13.4.0...v14.0.0)
Expand Down
24 changes: 0 additions & 24 deletions Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 7.0', :require => false
gem 'voxpupuli-test', '~> 8.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 3.5', :require => false
gem 'puppet_metadata', '~> 4.0', :require => false
end

group :development do
Expand Down
Loading