2026-01-13 21:12:24 -08:00
|
|
|
---
|
|
|
|
|
- name: Install prometheus via homebrew
|
|
|
|
|
community.general.homebrew:
|
|
|
|
|
name: prometheus
|
|
|
|
|
state: present
|
|
|
|
|
|
|
|
|
|
- name: Configure prometheus.yml
|
|
|
|
|
ansible.builtin.template:
|
|
|
|
|
src: prometheus.yml.j2
|
|
|
|
|
dest: /opt/homebrew/etc/prometheus.yml
|
|
|
|
|
mode: '0644'
|
2026-01-16 19:29:53 -08:00
|
|
|
notify: Restart prometheus
|
2026-01-13 21:12:24 -08:00
|
|
|
|
|
|
|
|
- name: Configure prometheus.args
|
|
|
|
|
ansible.builtin.template:
|
|
|
|
|
src: prometheus.args.j2
|
|
|
|
|
dest: /opt/homebrew/etc/prometheus.args
|
|
|
|
|
mode: '0644'
|
2026-01-16 19:29:53 -08:00
|
|
|
notify: Restart prometheus
|
2026-01-13 21:12:24 -08:00
|
|
|
|
|
|
|
|
- name: Ensure prometheus service is started
|
|
|
|
|
ansible.builtin.command: brew services start prometheus
|
2026-01-16 19:29:53 -08:00
|
|
|
register: prometheus_brew_start
|
|
|
|
|
changed_when: "'Successfully started' in prometheus_brew_start.stdout"
|
2026-01-13 21:12:24 -08:00
|
|
|
failed_when: false
|