Skip to content
This repository was archived by the owner on Mar 6, 2023. It is now read-only.

Commit c8e2796

Browse files
authored
Better tags and configuration handling (#66)
1 parent 00e37ce commit c8e2796

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

tasks/configure.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
---
2+
- name: Copy the Node Exporter systemd service file
3+
template:
4+
src: node_exporter.service.j2
5+
dest: /etc/systemd/system/node_exporter.service
6+
owner: root
7+
group: root
8+
mode: 0644
9+
notify: restart node_exporter
10+
211
- name: Create texfile collector dir
312
file:
413
path: "{{ node_exporter_textfile_dir }}"

tasks/install.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,3 @@
5858
group: "{{ node_exporter_system_group }}"
5959
notify: restart node_exporter
6060
when: not ansible_check_mode
61-
62-
- name: Copy the Node Exporter systemd service file
63-
template:
64-
src: node_exporter.service.j2
65-
dest: /etc/systemd/system/node_exporter.service
66-
owner: root
67-
group: root
68-
mode: 0644
69-
notify: restart node_exporter

tasks/main.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,25 @@
66
- "{{ ansible_distribution | lower }}.yml"
77
- "{{ ansible_os_family | lower }}.yml"
88
tags:
9-
- always
9+
- node_exporter_install
10+
- node_exporter_configure
11+
- node_exporter_run
1012

1113
- import_tasks: preflight.yml
1214
tags:
13-
- install
14-
- configure
15+
- node_exporter_install
16+
- node_exporter_configure
17+
- node_exporter_run
1518

1619
- import_tasks: install.yml
1720
become: true
1821
tags:
19-
- install
22+
- node_exporter_install
2023

2124
- import_tasks: configure.yml
2225
become: true
2326
tags:
24-
- configure
27+
- node_exporter_configure
2528

2629
- name: Ensure Node Exporter is enabled on boot
2730
become: true
@@ -30,4 +33,4 @@
3033
name: node_exporter
3134
enabled: true
3235
tags:
33-
- run
36+
- node_exporter_run

0 commit comments

Comments
 (0)