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
|
2024-07-09 15:43:41 -05:00
|
|
|
notify: restart prometheus container
|
|
|
|
- name: template out configuration file
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: prometheus.yml.j2
|
|
|
|
owner: 5476
|
|
|
|
group: 5476
|
|
|
|
mode: "0640"
|
|
|
|
dest: /data/prometheus/config/prometheus.yml
|
|
|
|
notify: restart prometheus container
|
2024-07-09 14:53:38 -05:00
|
|
|
- name: docker deploy prometheus
|
2024-07-09 15:43:41 -05:00
|
|
|
community.docker.docker_container:
|
2024-07-09 14:53:38 -05:00
|
|
|
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
|