25 lines
683 B
YAML
25 lines
683 B
YAML
|
|
---
|
||
|
|
- 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'
|
||
|
|
notify: restart prometheus
|
||
|
|
|
||
|
|
- name: Configure prometheus.args
|
||
|
|
ansible.builtin.template:
|
||
|
|
src: prometheus.args.j2
|
||
|
|
dest: /opt/homebrew/etc/prometheus.args
|
||
|
|
mode: '0644'
|
||
|
|
notify: restart prometheus
|
||
|
|
|
||
|
|
- name: Ensure prometheus service is started
|
||
|
|
ansible.builtin.command: brew services start prometheus
|
||
|
|
register: brew_start
|
||
|
|
changed_when: "'Successfully started' in brew_start.stdout"
|
||
|
|
failed_when: false
|