diff --git a/tasks/configure.yml b/tasks/configure.yml index 97375b0beff5fa9fcff8364d8601f1f5d8704754..ae684c34ab0c88928c51ab970d890e1daa0a57db 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -1,4 +1,13 @@ --- +- name: Copy the Node Exporter systemd service file + template: + src: node_exporter.service.j2 + dest: /etc/systemd/system/node_exporter.service + owner: root + group: root + mode: 0644 + notify: restart node_exporter + - name: Create texfile collector dir file: path: "{{ node_exporter_textfile_dir }}" diff --git a/tasks/install.yml b/tasks/install.yml index 5ab0ce22793e395f99a3861bc6362d00ac75fe38..c4294b0a597707acadbadb9a71324d0fdfcbead8 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -58,12 +58,3 @@ group: "{{ node_exporter_system_group }}" notify: restart node_exporter when: not ansible_check_mode - -- name: Copy the Node Exporter systemd service file - template: - src: node_exporter.service.j2 - dest: /etc/systemd/system/node_exporter.service - owner: root - group: root - mode: 0644 - notify: restart node_exporter diff --git a/tasks/main.yml b/tasks/main.yml index aaf0de1dafae6b43320789be7349059bb4ae9b88..ade82e7f6df64e16424710efb6c8e9c6d7daa24f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,22 +6,25 @@ - "{{ ansible_distribution | lower }}.yml" - "{{ ansible_os_family | lower }}.yml" tags: - - always + - node_exporter_install + - node_exporter_configure + - node_exporter_run - import_tasks: preflight.yml tags: - - install - - configure + - node_exporter_install + - node_exporter_configure + - node_exporter_run - import_tasks: install.yml become: true tags: - - install + - node_exporter_install - import_tasks: configure.yml become: true tags: - - configure + - node_exporter_configure - name: Ensure Node Exporter is enabled on boot become: true @@ -30,4 +33,4 @@ name: node_exporter enabled: true tags: - - run + - node_exporter_run