add promtail support
This commit is contained in:
parent
1b9547ecd8
commit
248ed5fd02
4 changed files with 60 additions and 1 deletions
|
|
@ -56,7 +56,7 @@
|
|||
name: certificates
|
||||
vars:
|
||||
certificates:
|
||||
certs: "{{ {}|combine(prometheus_certs, inventory_certs, recursive=True) }}"
|
||||
certs: "{{ { 'prometheus_agent': ({}|combine(prometheus_certs, inventory_certs, recursive=True))['prometheus_agent'] } }}"
|
||||
|
||||
- name: slurp up all scraper certs
|
||||
loop: "{{ prometheus_agent.scrapers.keys()|list }}"
|
||||
|
|
@ -123,6 +123,21 @@
|
|||
dest: /etc/prometheus/conf.d/rule_files/agent_{{ inventory_hostname }}.conf
|
||||
mode: 0644
|
||||
|
||||
- name: handle grafana-promtail
|
||||
when: prometheus_agent.agents.promtail.enable
|
||||
block:
|
||||
- name: install promtail
|
||||
apt:
|
||||
pkg: grafana-promtail
|
||||
- name: wrtie promtail config
|
||||
notify: restart grafana-promtail
|
||||
template:
|
||||
owner: grafana-promtail
|
||||
group: grafana-promtail
|
||||
mode: 0640
|
||||
dest: /etc/grafana-promtail.yml
|
||||
src: grafana-promtail.yml.j2
|
||||
|
||||
- name: create node-exporter-textfile group
|
||||
ansible.builtin.group:
|
||||
name: node-exporter-textfile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue