You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/roles/prometheus/tasks/main.yml

44 lines
923 B
YAML

---
- name: Install Prometheus Components
apt:
name:
- prometheus
- prometheus-alertmanager
- prometheus-pushgateway
state: latest
update_cache: true
register: apt_result
retries: 3
until: apt_result is succeeded
3 years ago
- name: Ensure the alert folder exist
file:
path: /etc/prometheus/alerts
state: directory
group: prometheus
owner: prometheus
mode: u=rwx,g=rx,o=rx
- name: Setup the prometheus config
template:
src: prometheus.yml
dest: /etc/prometheus/prometheus.yml
owner: prometheus
group: prometheus
3 years ago
mode: '0640'
notify: Restart prometheus
3 years ago
no_log: true
- name: Setup the arguments for node-exporter
template:
src: prometheus
dest: /etc/default/prometheus
owner: root
group: root
mode: '0644'
notify: Restart prometheus
vars:
args:
- name: web.listen-address
3 years ago
value: "{{ lan_address }}:9090"