Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Grotax committed Dec 21, 2024
1 parent bc227d2 commit 9f97ece
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion roles/prometheus/files/node_exporter.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After=network-online.target

[Service]
User=prometheus
ExecStart=/opt/node_exporter/node_exporter -collector.systemd -collector.processes --web.listen-address=127.0.0.1:9100
ExecStart=/opt/node_exporter/node_exporter --collector.systemd --collector.processes --web.listen-address=127.0.0.1:9100

[Install]
WantedBy=default.target
7 changes: 0 additions & 7 deletions roles/prometheus/tasks/download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,3 @@
group: prometheus
mode: '0744'
state: file

- name: Start node_exporter service
ansible.builtin.systemd:
daemon-reload: true
enabled: true
name: node_exporter
state: restarted
11 changes: 11 additions & 0 deletions roles/prometheus/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
owner: root
group: root

- name: Reload systemd
ansible.builtin.systemd:
daemon-reload: true

- name: Add prometheus system user for node_exporter
ansible.builtin.user:
name: prometheus
Expand All @@ -25,3 +29,10 @@
- name: Check if node_exporter-adv needs to be installed or upgraded
ansible.builtin.include_tasks: download.yml
when: installed_node_exporter_version.stdout != node_exporter_version

- name: Start node_exporter service
ansible.builtin.systemd:
daemon-reload: true
enabled: true
name: node_exporter
state: restarted

0 comments on commit 9f97ece

Please sign in to comment.