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 # defaults file for ansible-telegraf
telegraf_agent_version: 1.10.0 telegraf_agent_version: 1.10.0

View File

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