ansible/playbooks/tasks/web/prometheus.yml

31 lines
917 B
YAML
Raw Normal View History

2024-07-09 14:53:38 -05:00
# vim:ft=ansible:
- name: ensure prometheus dirs
ansible.builtin.file:
state: directory
owner: 5476
group: 5476
mode: "0750"
path: "{{ item }}"
with_items:
- /data/prometheus/config
- /data/prometheus/data
tags: [ docker, prometheus, monitoring ]
- name: docker deploy prometheus
# NOTE: If you're rebuilding this, you *need* to sync the data over as this
# container will try to explode if you run it with empty volumes. Copy over
# prometheus.yml into the config volume first or steal it from an empty fresh
# container instance
docker_container:
name: prometheus
image: prom/prometheus:latest
user: 5476:5476
env:
TZ: "America/Chicago"
networks:
- name: web
aliases: [ "prometheus" ]
volumes:
- /data/prometheus/config:/etc/prometheus
- /data/prometheus/data:/prometheus
tags: [ docker, prometheus, monitoring ]