|
|
|
@ -2,6 +2,9 @@
|
|
|
|
|
hosts: lotus-land-story
|
|
|
|
|
vars_files:
|
|
|
|
|
- vars.yml
|
|
|
|
|
vars:
|
|
|
|
|
prometheus_version: v2.43.0
|
|
|
|
|
cadvisor_version: v0.49.1
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
|
|
- name: Install host exporters
|
|
|
|
@ -54,10 +57,8 @@
|
|
|
|
|
|
|
|
|
|
- name: Run Prometheus
|
|
|
|
|
community.docker.docker_container:
|
|
|
|
|
# recreate: true
|
|
|
|
|
# restart: true
|
|
|
|
|
name: prometheus
|
|
|
|
|
image: prom/prometheus:v2.43.0
|
|
|
|
|
image: prom/prometheus:{{ prometheus_version }}
|
|
|
|
|
command:
|
|
|
|
|
- --config.file=/etc/prometheus/prometheus.yml
|
|
|
|
|
- --storage.tsdb.retention.size=5GB
|
|
|
|
@ -74,4 +75,18 @@
|
|
|
|
|
etc_hosts:
|
|
|
|
|
host.docker.internal: host-gateway
|
|
|
|
|
|
|
|
|
|
- name: Run cAdvisor
|
|
|
|
|
community.docker.docker_container:
|
|
|
|
|
name: cadvisor
|
|
|
|
|
image: gcr.io/cadvisor/cadvisor:{{ cadvisor_version }}
|
|
|
|
|
restart: true
|
|
|
|
|
volumes:
|
|
|
|
|
- /:/rootfs:ro
|
|
|
|
|
- /var/run:/var/run:rw
|
|
|
|
|
- /sys:/sys:ro
|
|
|
|
|
- /var/lib/docker/:/var/lib/docker:ro
|
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
|
networks:
|
|
|
|
|
- name: lotus_land_story
|
|
|
|
|
|
|
|
|
|
# vim: ft=yaml.ansible
|
|
|
|
|