Replaces the minimal project description with a comprehensive README including a component overview table, quick start instructions, common Ansible operations, and links to detailed documentation. Aligns with Red Panda Approval™ standards.
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
---
|
|
- name: Deploy Prometheus Alertmanager with Pushover
|
|
hosts: ubuntu
|
|
become: true
|
|
tasks:
|
|
- name: Check if host has alertmanager service
|
|
ansible.builtin.set_fact:
|
|
has_alertmanager_service: "{{'alertmanager' in services}}"
|
|
|
|
- name: Skip hosts without alertmanager service
|
|
ansible.builtin.meta: end_host
|
|
when: not has_alertmanager_service
|
|
|
|
- name: Install Alertmanager
|
|
ansible.builtin.apt:
|
|
name: prometheus-alertmanager
|
|
state: present
|
|
update_cache: true
|
|
|
|
- name: Create alertmanager config directory
|
|
ansible.builtin.file:
|
|
path: /etc/alertmanager
|
|
state: directory
|
|
owner: prometheus
|
|
group: prometheus
|
|
mode: '750'
|
|
|
|
- name: Template alertmanager configuration
|
|
ansible.builtin.template:
|
|
src: prometheus/alertmanager.yml
|
|
dest: /etc/alertmanager/alertmanager.yml
|
|
owner: prometheus
|
|
group: prometheus
|
|
mode: '550'
|
|
notify: restart alertmanager
|
|
|
|
- name: Start and enable Alertmanager service
|
|
ansible.builtin.systemd:
|
|
name: prometheus-alertmanager
|
|
state: started
|
|
enabled: true
|
|
daemon_reload: true
|
|
|
|
handlers:
|
|
- name: restart alertmanager
|
|
ansible.builtin.systemd:
|
|
name: prometheus-alertmanager
|
|
state: restarted |