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

[prometheus-exporters] Refactor systemd configuration #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
LOCALE_VERSION=0.3
CPU_MITIGATIONS_VERSION=0.5.0
PROMETHEUS_VERSION=0.8.0
PROMETHEUS_EXPORTERS_VERSION=1.4.1
PROMETHEUS_EXPORTERS_VERSION=1.5.0
GRAFANA_VERSION=0.11.0
VIRTUALIZATION_VERSION=0.6.2
SYSTEM_LOCK_VERSION=0.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Aug 22 13:49:43 UTC 2024 - Witek Bedyk <[email protected]>

- Version 1.5.0
* Set Environment= instead of EnvironmentFile= in systemd
configuration files

-------------------------------------------------------------------
Tue Jun 25 13:19:00 UTC 2024 - Witek Bedyk <[email protected]>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
%define fname prometheus-exporters
%define fdir %{_datadir}/susemanager/formulas
Name: prometheus-exporters-formula
Version: 1.4.1
Version: 1.5.0
Release: 0
Summary: Salt formula for installing and configuring Prometheus exporters
License: Apache-2.0
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Service]
EnvironmentFile=
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you want to keep this empty option in the config file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is to set it empty in case the option is set elsewhere. I don't want to use the EnvironmentFile= anymore unless there is a clear need for hiding the value.

Environment="ARGS={{ args }}"

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ARGS={{ args }}

This file was deleted.

This file was deleted.

10 changes: 7 additions & 3 deletions prometheus-exporters-formula/prometheus-exporters/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ node_exporter:
- name: {{ exporters.node_exporter_package }}
file.managed:
- name: {{ exporters.node_exporter_service_config }}
- source: {{ 'salt://prometheus-exporters/files/node-exporter-config.' ~ salt['grains.get']('os_family') }}
- source: salt://prometheus-exporters/files/node-exporter-systemd.config
- makedirs: True
- template: jinja
- user: root
Expand Down Expand Up @@ -144,7 +144,7 @@ apache_exporter:
- name: {{ exporters.apache_exporter_package }}
file.managed:
- name: {{ exporters.apache_exporter_service_config }}
- source: {{ 'salt://prometheus-exporters/files/apache-exporter-config.' ~ salt['grains.get']('os_family') }}
- source: salt://prometheus-exporters/files/apache-exporter-systemd.config
- makedirs: True
- template: jinja
- user: root
Expand All @@ -167,6 +167,10 @@ apache_exporter:
- pkg: apache_exporter
- watch_in:
- service: apache_exporter
module.run:
- name: service.systemctl_reload
- onchanges:
- file: {{ exporters.apache_exporter_service_config }}
service.running:
- name: {{ exporters.apache_exporter_service }}
- enable: True
Expand Down Expand Up @@ -208,7 +212,7 @@ postgres_exporter:
file.managed:
- names:
- {{ exporters.postgres_exporter_service_config }}:
- source: {{ 'salt://prometheus-exporters/files/postgres-exporter-config.' ~ salt['grains.get']('os_family') }}
- source: salt://prometheus-exporters/files/postgres-exporter-systemd.config
- {{ exporters.postgres_exporter_password_file }}:
- source: salt://prometheus-exporters/files/postgres-exporter-password
- user: prometheus
Expand Down
6 changes: 3 additions & 3 deletions prometheus-exporters-formula/prometheus-exporters/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'node_exporter_service_config': '/etc/sysconfig/prometheus-node_exporter',
'apache_exporter_package': 'golang-github-lusitaniae-apache_exporter',
'apache_exporter_service': 'prometheus-apache_exporter',
'apache_exporter_service_config': '/etc/sysconfig/prometheus-apache_exporter',
'apache_exporter_service_config': '/etc/systemd/system/prometheus-apache_exporter.service.d/60-suse-salt-formula.conf',
'postgres_exporter_package': 'prometheus-postgres_exporter',
'postgres_exporter_service': 'prometheus-postgres_exporter',
'postgres_exporter_service_config': '/etc/systemd/system/prometheus-postgres_exporter.service.d/60-suse-salt-formula.conf',
Expand All @@ -20,7 +20,7 @@
'node_exporter_service_config': '/etc/default/prometheus-node-exporter',
'apache_exporter_package': 'prometheus-apache-exporter',
'apache_exporter_service': 'prometheus-apache-exporter',
'apache_exporter_service_config': '/etc/default/prometheus-apache-exporter',
'apache_exporter_service_config': '/etc/systemd/system/prometheus-apache-exporter.service.d/60-suse-salt-formula.conf',
'postgres_exporter_package': 'prometheus-postgres-exporter',
'postgres_exporter_service': 'prometheus-postgres-exporter',
'postgres_exporter_service_config': '/etc/systemd/system/prometheus-postgres-exporter.service.d/60-suse-salt-formula.conf',
Expand All @@ -35,7 +35,7 @@
'node_exporter_service_config': '/etc/sysconfig/prometheus-node_exporter',
'apache_exporter_package': 'golang-github-lusitaniae-apache_exporter',
'apache_exporter_service': 'prometheus-apache_exporter',
'apache_exporter_service_config': '/etc/sysconfig/prometheus-apache_exporter',
'apache_exporter_service_config': '/etc/systemd/system/prometheus-apache_exporter.service.d/60-suse-salt-formula.conf',
'postgres_exporter_package': 'prometheus-postgres_exporter',
'postgres_exporter_service': 'prometheus-postgres_exporter',
'postgres_exporter_service_config': '/etc/systemd/system/prometheus-postgres_exporter.service.d/60-suse-salt-formula.conf',
Expand Down