mirror of
https://github.com/dj-wasabi/ansible-telegraf.git
synced 2025-07-17 08:46:37 +00:00
Merge pull request #73 from jdivy/windows
A few enhancements and fixes to windows support
This commit is contained in:
@ -57,7 +57,7 @@ telegraf_redhat_releasever: "$releasever"
|
|||||||
|
|
||||||
telegraf_win_install_dir: 'C:\Telegraf'
|
telegraf_win_install_dir: 'C:\Telegraf'
|
||||||
telegraf_win_logfile: 'C:\\Telegraf\\telegraf.log'
|
telegraf_win_logfile: 'C:\\Telegraf\\telegraf.log'
|
||||||
telegraf_win_include: 'C:\Telegraf\telegraf_agent.d\'
|
telegraf_win_include: 'C:\Telegraf\telegraf_agent.d'
|
||||||
telegraf_win_service_args:
|
telegraf_win_service_args:
|
||||||
- -service install
|
- -service install
|
||||||
- -config {{ telegraf_win_install_dir }}\telegraf\telegraf.conf
|
- -config {{ telegraf_win_install_dir }}\telegraf\telegraf.conf
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
- name: "Windows | Copy telegraf extra plugins"
|
- name: "Windows | Copy telegraf extra plugins"
|
||||||
win_template:
|
win_template:
|
||||||
src: "telegraf-extra-plugin.conf.j2"
|
src: "telegraf-extra-plugin.conf.j2"
|
||||||
dest: "/etc/telegraf/telegraf.d/{{ item.key }}.conf"
|
dest: '{{ telegraf_win_include }}\{{ item.key }}.conf'
|
||||||
with_dict: "{{ telegraf_plugins_extra }}"
|
with_dict: "{{ telegraf_plugins_extra }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.key }}"
|
label: "{{ item.key }}"
|
||||||
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
- name: "Windows | Remove telegraf extra plugins"
|
- name: "Windows | Remove telegraf extra plugins"
|
||||||
win_file:
|
win_file:
|
||||||
path: "/etc/telegraf/telegraf.d/{{ item.key }}.conf"
|
path: '{{ telegraf_win_include }}\{{ item.key }}.conf'
|
||||||
state: absent
|
state: absent
|
||||||
with_dict: "{{ telegraf_plugins_extra }}"
|
with_dict: "{{ telegraf_plugins_extra }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
|
@ -94,6 +94,16 @@
|
|||||||
{{ items }}
|
{{ items }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if item.objects is defined and item.objects is iterable %}
|
||||||
|
{% for object in item.objects %}
|
||||||
|
[[inputs.{{ item.plugin }}.object]]
|
||||||
|
ObjectName = {{ object.name | tojson }}
|
||||||
|
Instances = {{ object.instances | default(["*"]) }}
|
||||||
|
Counters = {{ object.counters | default(["*"]) }}
|
||||||
|
Measurement = {{ object.measurement | default("win_perf_counters") | tojson }}
|
||||||
|
IncludeTotal = {{ object.total | default(false) | string | lower }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
{% if item.specifications is defined and item.specifications is iterable %}
|
{% if item.specifications is defined and item.specifications is iterable %}
|
||||||
[[{{item.plugin}}.specifications]]
|
[[{{item.plugin}}.specifications]]
|
||||||
{% for items in item.specifications %}
|
{% for items in item.specifications %}
|
||||||
|
Reference in New Issue
Block a user