Add some (admittedly crusty) support for podman for Prometheus monitoring
This commit is contained in:
parent
f23d6ed738
commit
391e424199
@ -2,7 +2,7 @@
|
||||
# vim:ft=ansible:
|
||||
---
|
||||
- hosts: tags_nagios
|
||||
gather_facts: no
|
||||
gather_facts: yes
|
||||
tasks:
|
||||
- name: assure nagios user
|
||||
ansible.builtin.user: name=nagios-checker state=absent remove=yes
|
||||
@ -10,36 +10,72 @@
|
||||
- name: assure nagios user sudo rule file
|
||||
ansible.builtin.file: path=/etc/sudoers.d/50-nagios-checker state=absent
|
||||
tags: [ nagios, sudo ]
|
||||
- name: assure prometheus node exporter
|
||||
# https://github.com/prometheus/node_exporter
|
||||
ansible.builtin.docker_container:
|
||||
name: prometheus-node-exporter
|
||||
image: quay.io/prometheus/node-exporter:latest
|
||||
restart_policy: unless-stopped
|
||||
command:
|
||||
- '--path.rootfs=/host'
|
||||
- '--collector.interrupts'
|
||||
- '--collector.processes'
|
||||
network_mode: host
|
||||
pid_mode: host
|
||||
volumes:
|
||||
- /:/host:ro,rslave
|
||||
tags: [ prometheus ]
|
||||
- name: assure prometheus cadvisor exporter
|
||||
ansible.builtin.docker_container:
|
||||
name: prometheus-cadvisor-exporter
|
||||
image: gcr.io/cadvisor/cadvisor:latest
|
||||
restart_policy: unless-stopped
|
||||
ports:
|
||||
- 9101:8080/tcp
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /var/run:/var/run:ro
|
||||
- /sys:/sys:ro
|
||||
- /var/lib/docker:/var/lib/docker:ro
|
||||
- /dev/disk:/dev/disk:ro
|
||||
devices:
|
||||
- /dev/kmsg
|
||||
- name: assure prometheus containers for docker hosts
|
||||
block:
|
||||
- name: assure prometheus node exporter
|
||||
# https://github.com/prometheus/node_exporter
|
||||
ansible.builtin.docker_container:
|
||||
name: prometheus-node-exporter
|
||||
image: quay.io/prometheus/node-exporter:latest
|
||||
restart_policy: unless-stopped
|
||||
command:
|
||||
- '--path.rootfs=/host'
|
||||
- '--collector.interrupts'
|
||||
- '--collector.processes'
|
||||
network_mode: host
|
||||
pid_mode: host
|
||||
volumes:
|
||||
- /:/host:ro,rslave
|
||||
tags: [ prometheus ]
|
||||
- name: assure prometheus cadvisor exporter
|
||||
ansible.builtin.docker_container:
|
||||
name: prometheus-cadvisor-exporter
|
||||
image: gcr.io/cadvisor/cadvisor:latest
|
||||
restart_policy: unless-stopped
|
||||
ports:
|
||||
- 9101:8080/tcp
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /var/run:/var/run:ro
|
||||
- /sys:/sys:ro
|
||||
- /var/lib/docker:/var/lib/docker:ro
|
||||
- /dev/disk:/dev/disk:ro
|
||||
devices:
|
||||
- /dev/kmsg
|
||||
when: ansible_pkg_mgr != "atomic_container"
|
||||
- name: assure prometheus containers for coreos
|
||||
block:
|
||||
- name: assure prometheus node exporter
|
||||
# https://github.com/prometheus/node_exporter
|
||||
containers.podman.podman_container:
|
||||
name: prometheus-node-exporter
|
||||
image: quay.io/prometheus/node-exporter:latest
|
||||
restart_policy: unless-stopped
|
||||
command:
|
||||
- '--path.rootfs=/host'
|
||||
- '--collector.interrupts'
|
||||
- '--collector.processes'
|
||||
network_mode: host
|
||||
pid_mode: host
|
||||
volumes:
|
||||
- /:/host:ro,rslave
|
||||
tags: [ prometheus ]
|
||||
- name: assure prometheus cadvisor exporter
|
||||
containers.podman.podman_container:
|
||||
name: prometheus-cadvisor-exporter
|
||||
image: gcr.io/cadvisor/cadvisor:latest
|
||||
restart_policy: unless-stopped
|
||||
privileged: yes
|
||||
ports:
|
||||
- 9101:8080/tcp
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /var/run:/var/run:ro
|
||||
- /sys:/sys:ro
|
||||
- /dev/disk:/dev/disk:ro
|
||||
device:
|
||||
- /dev/kmsg
|
||||
when: ansible_pkg_mgr == "atomic_container"
|
||||
- hosts: all
|
||||
gather_facts: no
|
||||
tasks:
|
||||
|
Loading…
Reference in New Issue
Block a user