mirror of
https://gitlab.com/s3lph/ansible-collection-prometheus
synced 2024-11-22 17:51:01 +01:00
Fix: OpenBSD doesn't have aroot group, called wheel instead
This commit is contained in:
parent
c243e7d35e
commit
0b7dc9e3e5
7 changed files with 20 additions and 14 deletions
|
@ -4,8 +4,8 @@
|
|||
ansible.builtin.template:
|
||||
src: "{{ basename }}.j2"
|
||||
dest: "/usr/local/bin/{{ basename }}"
|
||||
owner: root
|
||||
group: prometheus
|
||||
owner: "{{ prometheus_node_root_user }}"
|
||||
group: "{{ prometheus_node_group }}"
|
||||
mode: 0750
|
||||
vars:
|
||||
basename: "{{ item.value.template_base_name | default('prometheus-node-exporter-' + item.key + '.sh') }}"
|
||||
|
@ -15,8 +15,8 @@
|
|||
ansible.builtin.copy:
|
||||
content: "{{ item.value.config.content }}"
|
||||
dest: "{{ item.value.config.filename }}"
|
||||
owner: root
|
||||
group: prometheus
|
||||
owner: "{{ prometheus_node_root_user }}"
|
||||
group: "{{ prometheus_node_group }}"
|
||||
mode: 0640
|
||||
when: "'config' in item.value"
|
||||
loop: "{{ prometheus_textfile_collectors | dict2items }}"
|
||||
|
@ -25,8 +25,8 @@
|
|||
ansible.builtin.template:
|
||||
src: "etc/systemd/system/prometheus-collector.service.j2"
|
||||
dest: "/etc/systemd/system/prometheus-node-exporter-{{ item.key }}.service"
|
||||
owner: root
|
||||
group: root
|
||||
owner: "{{ prometheus_node_root_user }}"
|
||||
group: "{{ prometheus_node_root_group }}"
|
||||
mode: 0644
|
||||
vars:
|
||||
basename: "{{ item.value.template_base_name | default('prometheus-node-exporter-' + item.key + '.sh') }}"
|
||||
|
@ -39,8 +39,8 @@
|
|||
ansible.builtin.template:
|
||||
src: "etc/systemd/system/prometheus-collector.timer.j2"
|
||||
dest: "/etc/systemd/system/prometheus-node-exporter-{{ item.key }}.timer"
|
||||
owner: root
|
||||
group: root
|
||||
owner: "{{ prometheus_node_root_user }}"
|
||||
group: "{{ prometheus_node_root_group }}"
|
||||
mode: 0644
|
||||
loop: "{{ prometheus_textfile_collectors | dict2items }}"
|
||||
notify:
|
||||
|
@ -59,8 +59,8 @@
|
|||
ansible.builtin.template:
|
||||
src: "etc/cron.d/prometheus-node-exporter.j2"
|
||||
dest: "{{ prometheus_node_crontab }}"
|
||||
owner: root
|
||||
group: root
|
||||
owner: "{{ prometheus_node_root_user }}"
|
||||
group: "{{ prometheus_node_root_group }}"
|
||||
mode: 0644
|
||||
vars:
|
||||
collectors: "{{ prometheus_textfile_collectors }}"
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
ansible.builtin.template:
|
||||
src: etc/default/prometheus-node-exporter.j2
|
||||
dest: /etc/default/prometheus-node-exporter
|
||||
owner: root
|
||||
group: root
|
||||
owner: "{{ prometheus_node_root_user }}"
|
||||
group: "{{ prometheus_node_root_group }}"
|
||||
mode: 0644
|
||||
vars:
|
||||
args: "{{ prometheus_node_exporter_args }}"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
- ansible_virtualization_role == 'host'
|
||||
|
||||
- name: start prometheus-node-exporter-smartmon.timer
|
||||
ansible.builtin.systemd:
|
||||
ansible.builtin.service:
|
||||
name: prometheus-node-exporter-smartmon.timer
|
||||
state: "{{ (ansible_virtualization_role == 'host' and not smartmon_exporter_force_off) | ternary('started', 'stopped') }}"
|
||||
enabled: "{{ ansible_virtualization_role == 'host' }}"
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
ansible.builtin.file:
|
||||
path: "{{ prometheus_node_textfile_dir }}"
|
||||
state: directory
|
||||
owner: root
|
||||
owner: "{{ prometheus_node_root_user }}"
|
||||
group: "{{ prometheus_node_group }}"
|
||||
mode: 0750
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
|
||||
prometheus_node_root_user: root
|
||||
prometheus_node_root_group: root
|
||||
prometheus_node_user: prometheus
|
||||
prometheus_node_group: prometheus
|
||||
prometheus_node_service: prometheus-node-exporter
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
|
||||
prometheus_node_root_user: root
|
||||
prometheus_node_root_group: wheel
|
||||
prometheus_node_user: _nodeexporter
|
||||
prometheus_node_group: _nodeexporter
|
||||
prometheus_node_service: node_exporter
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
---
|
||||
|
||||
prometheus_node_root_user: root
|
||||
prometheus_node_root_group: root
|
||||
prometheus_node_user: prometheus
|
||||
prometheus_node_group: prometheus
|
||||
prometheus_node_service: prometheus-node-exporter
|
||||
|
|
Loading…
Reference in a new issue