Skip to content

Commit

Permalink
Test default scrape configs path
Browse files Browse the repository at this point in the history
Signed-off-by: Leonhard Mayr <[email protected]>
  • Loading branch information
manzsolutions-lpr committed Jun 10, 2024
1 parent 47d25ca commit 8ea230c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions roles/prometheus/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
- name: Run local preparation
hosts: localhost
gather_facts: false
tasks:
- name: Create scrapes directory
ansible.builtin.file:
name: prometheus/scrapes
state: directory
recurse: true
check_mode: false
- name: Create empty scrape config file
ansible.builtin.file:
name: prometheus/scrapes/empty_scrapes.yml
state: touch
mode: 0664
check_mode: false
2 changes: 2 additions & 0 deletions roles/prometheus/molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def AnsibleDefaults():
"/etc/prometheus/consoles",
"/etc/prometheus/rules",
"/etc/prometheus/file_sd",
"/etc/prometheus/scrapes",
"/var/lib/prometheus"
])
def test_directories(host, dirs):
Expand All @@ -34,6 +35,7 @@ def test_directories(host, dirs):
"/etc/prometheus/prometheus.yml",
"/etc/prometheus/console_libraries/prom.lib",
"/etc/prometheus/consoles/prometheus.html",
"/etc/prometheus/scrapes/empty_scrapes.yml",
"/etc/prometheus/web.yml",
"/etc/systemd/system/prometheus.service",
"/usr/local/bin/prometheus",
Expand Down

0 comments on commit 8ea230c

Please sign in to comment.