Use Grafana's upstream Debian packages for promtail
Migration playbook:
- name: Cleanup old promtail install
hosts: all
tasks:
- name: Stop and disable old service
when: prometheus_agent.agents.promtail.enable
service:
name: grafana-promtail
state: stopped
enabled: false
- name: Migrate state dir
when: prometheus_agent.agents.promtail.enable
copy:
src: /var/lib/grafana-promtail/
dest: /var/lib/promtail/
remote_src: yes
- name: Uninstall old package
when: prometheus_agent.agents.promtail.enable
apt:
name: grafana-promtail
state: absent
purge: true # Removes user, group and /var/lib/grafana-promtail
- name: create promtail group
when: prometheus_agent.agents.promtail.enable
group:
name: promtail
system: true
- name: create promtail user
when: prometheus_agent.agents.promtail.enable
user:
name: promtail
system: true
group: promtail
home: /var/lib/promtail
- name: Fix state dir owner and group
when: prometheus_agent.agents.promtail.enable
file:
name: /var/lib/promtail/
state: directory
recurse: true
owner: promtail
group: promtail
This commit is contained in:
parent
dfa8092538
commit
c236bb61a4
3 changed files with 27 additions and 10 deletions
|
|
@ -13,9 +13,9 @@
|
|||
name: prometheus-blackbox-exporter
|
||||
state: restarted
|
||||
|
||||
- name: restart grafana-promtail
|
||||
- name: restart promtail
|
||||
service:
|
||||
name: grafana-promtail
|
||||
name: promtail
|
||||
state: restarted
|
||||
|
||||
- name: restart snmp exporter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue