Files
beepi/playbooks/monitoring/monitoring.yml
T
2026-04-27 15:07:54 +02:00

57 lines
1.6 KiB
YAML

- name: Prometheus
hosts: pi
become: true
vars:
grafana_secret: !vault |
$ANSIBLE_VAULT;1.1;AES256
38343463346232356634353236356534666166626665663237306130623336373062363563386537
6665356165346134643235383164383266373363316262310a613332386564636430643561373463
36346437353963333839656163623933616662326132373036636166616538343966356361636164
3035656163616631330a663363343363643065356535356633623638376430326539363536666638
65333930613135333364383462363233386662386531323935353932373465363234
tasks:
- name: Install podman
ansible.builtin.apt:
name: podman
state: present
- name: Install podman-compose
ansible.builtin.apt:
name: podman-compose
state: present
- name: Install prometheus-node-exporter
ansible.builtin.apt:
name: prometheus-node-exporter
state: present
- name: Create prometheus config directory
ansible.builtin.file:
path: /opt/monitoring
state: directory
mode: '0755'
- name: Copy config
ansible.builtin.copy:
src: prometheus_config.yml
dest: /opt/monitoring/prometheus.yml
mode: '0644'
- name: Copy compose
ansible.builtin.template:
src: docker-compose.yml.j2
dest: /opt/monitoring/docker-compose.yml
mode: '0644'
- name: Compose down
changed_when: true
ansible.builtin.command:
cmd: podman-compose down
chdir: /opt/monitoring
- name: Compose up
changed_when: true
ansible.builtin.command:
cmd: podman-compose up -d
chdir: /opt/monitoring