made service status configurable

This commit is contained in:
DEvil0000
2020-06-23 15:28:42 +02:00
parent 08b1c62710
commit 20a7653f95
2 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
---
telegraf_enabled: True
# defaults file for ansible-telegraf
telegraf_agent_version: 1.10.0

View File

@ -124,8 +124,8 @@
- name: "Start Telegraf (If it wasn't running)"
service:
name: telegraf
state: started
enabled: yes
state: "{{ telegraf_enabled | ternary('started', 'stopped') }}"
enabled: "{{ telegraf_enabled }}"
become: yes
when: not telegraf_agent_docker