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

Commit

Permalink
Fix custom rule/target file copy (#132)
Browse files Browse the repository at this point in the history
[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 <[email protected]>
  • Loading branch information
SuperQ authored Jul 15, 2018
1 parent f7ca807 commit 47c72e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Empty file.
Empty file.
9 changes: 5 additions & 4 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
- name: copy custom alerting rule files
copy:
src: "{{ item }}"
dest: "{{ prometheus_config_dir }}/rules/{{ item | splitext | difference(['.rules']) | join('') }}.rules"
dest: "{{ prometheus_config_dir }}/rules/"
owner: root
group: prometheus
mode: 0640
validate: "/usr/local/bin/promtool check rules %s"
with_fileglob:
- prometheus/rules/*
- prometheus/rules/*.rules
notify:
- reload prometheus

Expand Down Expand Up @@ -54,10 +54,11 @@
- name: copy prometheus custom static targets
copy:
src: "{{ item }}"
dest: "{{ prometheus_config_dir }}/file_sd/{{ item | splitext | difference(['.yml']) | join('') }}.yml"
dest: "{{ prometheus_config_dir }}/file_sd/"
force: true
owner: root
group: prometheus
mode: 0640
with_fileglob:
- prometheus/targets/*
- prometheus/targets/*.yml
- prometheus/targets/*.json

0 comments on commit 47c72e9

Please sign in to comment.