ansible/roles/prometheus/tasks/main.yml

34 lines
860 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
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
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