mirror of
https://gitlab.com/s3lph/ansible-collection-prometheus
synced 2024-11-23 02:01:10 +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:
|
ansible.builtin.template:
|
||||||
src: "{{ basename }}.j2"
|
src: "{{ basename }}.j2"
|
||||||
dest: "/usr/local/bin/{{ basename }}"
|
dest: "/usr/local/bin/{{ basename }}"
|
||||||
owner: root
|
owner: "{{ prometheus_node_root_user }}"
|
||||||
group: prometheus
|
group: "{{ prometheus_node_group }}"
|
||||||
mode: 0750
|
mode: 0750
|
||||||
vars:
|
vars:
|
||||||
basename: "{{ item.value.template_base_name | default('prometheus-node-exporter-' + item.key + '.sh') }}"
|
basename: "{{ item.value.template_base_name | default('prometheus-node-exporter-' + item.key + '.sh') }}"
|
||||||
|
@ -15,8 +15,8 @@
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
content: "{{ item.value.config.content }}"
|
content: "{{ item.value.config.content }}"
|
||||||
dest: "{{ item.value.config.filename }}"
|
dest: "{{ item.value.config.filename }}"
|
||||||
owner: root
|
owner: "{{ prometheus_node_root_user }}"
|
||||||
group: prometheus
|
group: "{{ prometheus_node_group }}"
|
||||||
mode: 0640
|
mode: 0640
|
||||||
when: "'config' in item.value"
|
when: "'config' in item.value"
|
||||||
loop: "{{ prometheus_textfile_collectors | dict2items }}"
|
loop: "{{ prometheus_textfile_collectors | dict2items }}"
|
||||||
|
@ -25,8 +25,8 @@
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "etc/systemd/system/prometheus-collector.service.j2"
|
src: "etc/systemd/system/prometheus-collector.service.j2"
|
||||||
dest: "/etc/systemd/system/prometheus-node-exporter-{{ item.key }}.service"
|
dest: "/etc/systemd/system/prometheus-node-exporter-{{ item.key }}.service"
|
||||||
owner: root
|
owner: "{{ prometheus_node_root_user }}"
|
||||||
group: root
|
group: "{{ prometheus_node_root_group }}"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
vars:
|
vars:
|
||||||
basename: "{{ item.value.template_base_name | default('prometheus-node-exporter-' + item.key + '.sh') }}"
|
basename: "{{ item.value.template_base_name | default('prometheus-node-exporter-' + item.key + '.sh') }}"
|
||||||
|
@ -39,8 +39,8 @@
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "etc/systemd/system/prometheus-collector.timer.j2"
|
src: "etc/systemd/system/prometheus-collector.timer.j2"
|
||||||
dest: "/etc/systemd/system/prometheus-node-exporter-{{ item.key }}.timer"
|
dest: "/etc/systemd/system/prometheus-node-exporter-{{ item.key }}.timer"
|
||||||
owner: root
|
owner: "{{ prometheus_node_root_user }}"
|
||||||
group: root
|
group: "{{ prometheus_node_root_group }}"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
loop: "{{ prometheus_textfile_collectors | dict2items }}"
|
loop: "{{ prometheus_textfile_collectors | dict2items }}"
|
||||||
notify:
|
notify:
|
||||||
|
@ -59,8 +59,8 @@
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "etc/cron.d/prometheus-node-exporter.j2"
|
src: "etc/cron.d/prometheus-node-exporter.j2"
|
||||||
dest: "{{ prometheus_node_crontab }}"
|
dest: "{{ prometheus_node_crontab }}"
|
||||||
owner: root
|
owner: "{{ prometheus_node_root_user }}"
|
||||||
group: root
|
group: "{{ prometheus_node_root_group }}"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
vars:
|
vars:
|
||||||
collectors: "{{ prometheus_textfile_collectors }}"
|
collectors: "{{ prometheus_textfile_collectors }}"
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: etc/default/prometheus-node-exporter.j2
|
src: etc/default/prometheus-node-exporter.j2
|
||||||
dest: /etc/default/prometheus-node-exporter
|
dest: /etc/default/prometheus-node-exporter
|
||||||
owner: root
|
owner: "{{ prometheus_node_root_user }}"
|
||||||
group: root
|
group: "{{ prometheus_node_root_group }}"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
vars:
|
vars:
|
||||||
args: "{{ prometheus_node_exporter_args }}"
|
args: "{{ prometheus_node_exporter_args }}"
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
- ansible_virtualization_role == 'host'
|
- ansible_virtualization_role == 'host'
|
||||||
|
|
||||||
- name: start prometheus-node-exporter-smartmon.timer
|
- name: start prometheus-node-exporter-smartmon.timer
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.service:
|
||||||
name: prometheus-node-exporter-smartmon.timer
|
name: prometheus-node-exporter-smartmon.timer
|
||||||
state: "{{ (ansible_virtualization_role == 'host' and not smartmon_exporter_force_off) | ternary('started', 'stopped') }}"
|
state: "{{ (ansible_virtualization_role == 'host' and not smartmon_exporter_force_off) | ternary('started', 'stopped') }}"
|
||||||
enabled: "{{ ansible_virtualization_role == 'host' }}"
|
enabled: "{{ ansible_virtualization_role == 'host' }}"
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ prometheus_node_textfile_dir }}"
|
path: "{{ prometheus_node_textfile_dir }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: root
|
owner: "{{ prometheus_node_root_user }}"
|
||||||
group: "{{ prometheus_node_group }}"
|
group: "{{ prometheus_node_group }}"
|
||||||
mode: 0750
|
mode: 0750
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
|
prometheus_node_root_user: root
|
||||||
|
prometheus_node_root_group: root
|
||||||
prometheus_node_user: prometheus
|
prometheus_node_user: prometheus
|
||||||
prometheus_node_group: prometheus
|
prometheus_node_group: prometheus
|
||||||
prometheus_node_service: prometheus-node-exporter
|
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_user: _nodeexporter
|
||||||
prometheus_node_group: _nodeexporter
|
prometheus_node_group: _nodeexporter
|
||||||
prometheus_node_service: node_exporter
|
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_user: prometheus
|
||||||
prometheus_node_group: prometheus
|
prometheus_node_group: prometheus
|
||||||
prometheus_node_service: prometheus-node-exporter
|
prometheus_node_service: prometheus-node-exporter
|
||||||
|
|
Loading…
Reference in a new issue