mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-10 14:24:25 +00:00
fix: always create config file
Signed-off-by: Logan Pulley <logan@pulley.host>
This commit is contained in:
parent
1e953d4b27
commit
456d8ac946
1 changed files with 15 additions and 21 deletions
|
@ -8,28 +8,22 @@
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart node_exporter
|
notify: restart node_exporter
|
||||||
|
|
||||||
- name: Configure node_exporter
|
- name: Create node_exporter config directory
|
||||||
when:
|
ansible.builtin.file:
|
||||||
( node_exporter_tls_server_config | length > 0 ) or
|
path: "/etc/node_exporter"
|
||||||
( node_exporter_http_server_config | length > 0 ) or
|
state: directory
|
||||||
( node_exporter_basic_auth_users | length > 0 )
|
owner: root
|
||||||
block:
|
group: root
|
||||||
- name: Create node_exporter config directory
|
mode: u+rwX,g+rwX,o=rX
|
||||||
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
|
- name: Copy the node_exporter config file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: config.yaml.j2
|
src: config.yaml.j2
|
||||||
dest: /etc/node_exporter/config.yaml
|
dest: /etc/node_exporter/config.yaml
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
notify: restart node_exporter
|
notify: restart node_exporter
|
||||||
|
|
||||||
- name: Create textfile collector dir
|
- name: Create textfile collector dir
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|
Loading…
Reference in a new issue