🔨 manage docker plugin

This commit is contained in:
SebClem 2022-02-04 10:20:10 +01:00
parent b93a4dc2f8
commit fb539a0531
No known key found for this signature in database
GPG Key ID: 3D8E353F900B1305
4 changed files with 29 additions and 2 deletions

View File

@ -101,3 +101,6 @@ promtail_scrape_config:
promtail_target_config: []
promtail_positions_config:
filename: /tmp/positions.yaml
loki_docker_driver: false

View File

@ -32,3 +32,8 @@
state: reloaded
enabled: true
when: ('promtail' in loki_bins)
- name: Restart Docker
ansible.builtin.service:
name: docker
state: restarted

13
tasks/docker_driver.yml Normal file
View File

@ -0,0 +1,13 @@
---
- name: Install Loki docker driver
community.docker.docker_plugin:
plugin_name: grafana/loki-docker-driver:latest
alias: loki
state: present
- name: Enable Loki docker driver
community.docker.docker_plugin:
plugin_name: grafana/loki-docker-driver:latest
state: enabled
notify: Restart Docker

View File

@ -12,3 +12,9 @@
become: true
tags:
- loki_configure
- name: Install docker driver
ansible.builtin.include_tasks: docker_driver.yml
when: loki_docker_driver
tags:
- loki_configure