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

Commit 47c72e9

Browse files
authored
Fix custom rule/target file copy (#132)
[patch] Remove placeholder dirs as they cause Ansible to ignore local files dirs. Simplify fileglob by only copying valid filenames. Signed-off-by: Ben Kochie <superq@gmail.com>
1 parent f7ca807 commit 47c72e9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

files/prometheus/rules/.placeholder

Whitespace-only changes.

files/prometheus/targets/.placeholder

Whitespace-only changes.

tasks/configure.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
- name: copy custom alerting rule files
1717
copy:
1818
src: "{{ item }}"
19-
dest: "{{ prometheus_config_dir }}/rules/{{ item | splitext | difference(['.rules']) | join('') }}.rules"
19+
dest: "{{ prometheus_config_dir }}/rules/"
2020
owner: root
2121
group: prometheus
2222
mode: 0640
2323
validate: "/usr/local/bin/promtool check rules %s"
2424
with_fileglob:
25-
- prometheus/rules/*
25+
- prometheus/rules/*.rules
2626
notify:
2727
- reload prometheus
2828

@@ -54,10 +54,11 @@
5454
- name: copy prometheus custom static targets
5555
copy:
5656
src: "{{ item }}"
57-
dest: "{{ prometheus_config_dir }}/file_sd/{{ item | splitext | difference(['.yml']) | join('') }}.yml"
57+
dest: "{{ prometheus_config_dir }}/file_sd/"
5858
force: true
5959
owner: root
6060
group: prometheus
6161
mode: 0640
6262
with_fileglob:
63-
- prometheus/targets/*
63+
- prometheus/targets/*.yml
64+
- prometheus/targets/*.json

0 commit comments

Comments
 (0)