Skip to content

Commit

Permalink
Merge pull request #113 from lpulley/patch-2
Browse files Browse the repository at this point in the history
fix: always create config file
  • Loading branch information
gardar authored May 24, 2023
2 parents 1e953d4 + 456d8ac commit 60bf4ba
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions roles/node_exporter/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,22 @@
mode: 0644
notify: restart node_exporter

- name: Configure node_exporter
when:
( node_exporter_tls_server_config | length > 0 ) or
( node_exporter_http_server_config | length > 0 ) or
( node_exporter_basic_auth_users | length > 0 )
block:
- name: Create node_exporter config directory
ansible.builtin.file:
path: "/etc/node_exporter"
state: directory
owner: root
group: root
mode: u+rwX,g+rwX,o=rX
- name: Create node_exporter config directory
ansible.builtin.file:
path: "/etc/node_exporter"
state: directory
owner: root
group: root
mode: u+rwX,g+rwX,o=rX

- name: Copy the node_exporter config file
ansible.builtin.template:
src: config.yaml.j2
dest: /etc/node_exporter/config.yaml
owner: root
group: root
mode: 0644
notify: restart node_exporter
- name: Copy the node_exporter config file
ansible.builtin.template:
src: config.yaml.j2
dest: /etc/node_exporter/config.yaml
owner: root
group: root
mode: 0644
notify: restart node_exporter

- name: Create textfile collector dir
ansible.builtin.file:
Expand Down

0 comments on commit 60bf4ba

Please sign in to comment.