feat: adding telegraf to docker group if docker is installed

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2023-03-12 14:34:43 +01:00
parent 20fd717e0b
commit 700396cc31
No known key found for this signature in database
GPG Key ID: 0C87282F76E61283

View File

@ -27,6 +27,17 @@
state: latest state: latest
update_cache: true update_cache: true
- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto
- name: Add telegraf to docker group
ansible.builtin.user:
name: telegraf
groups: docker
append: true
when: "'docker-ce' in ansible_facts.packages"
- name: Enable telegraf service - name: Enable telegraf service
ansible.builtin.service: ansible.builtin.service:
name: telegraf name: telegraf