adjustments for Windows >= 1.15

This commit is contained in:
Heckel, Robert J
2020-12-23 11:52:59 -06:00
parent 8d25c09575
commit 4e31a334a7
2 changed files with 24 additions and 1 deletions

View File

@ -118,6 +118,7 @@ These properties set in how and what package will be installed.
* `telegraf_agent_metric_buffer_limit`: The agent metric buffer limit. Default: 10000 (since v0.13)
* `telegraf_agent_quiet`: Run Telegraf in quiet mode (error messages only). Default: `False` (since v0.13)
* `telegraf_agent_logfile`: The agent logfile name. Default: '' (means to log to stdout) (since v1.1)
* `telegraf_agent_hostname`: The agent hostname. Default: `ansible_fqdn`
* `telegraf_agent_omit_hostname`: Do no set the "host" tag in the agent. Default: `False` (since v1.1)
### Docker specific role variables:

View File

@ -20,11 +20,27 @@
when:
- not file_info.stat.exists
- name: "Windows | Unzip file"
- name: "Windows | Unzip file (newer than 1.15)"
win_unzip:
src: '{{ telegraf_win_install_dir }}\telegraf-{{ telegraf_agent_version }}_windows_amd64.zip'
dest: "{{ telegraf_win_install_dir }}"
creates: '{{ telegraf_win_install_dir }}\telegraf-{{ telegraf_agent_version }}\telegraf.exe'
when: telegraf_agent_version is version('1.15', '>=')
- name: "Windows | Move extracted directory (newer than 1.15)"
win_copy:
src: '{{ telegraf_win_install_dir }}\telegraf-{{ telegraf_agent_version }}\'
dest: '{{ telegraf_win_install_dir }}\telegraf'
remote_src: yes
when: telegraf_agent_version is version('1.15', '>=')
- name: "Windows | Unzip file"
win_unzip:
src: '{{ telegraf_win_install_dir }}\telegraf-{{ telegraf_agent_version }}_windows_amd64.zip'
dest: '{{ telegraf_win_install_dir }}'
creates: '{{ telegraf_win_install_dir }}\telegraf\telegraf.exe'
delete_archive: yes
when: telegraf_agent_version is version('1.15', '<')
- name: "Windows | Configure Telegraf"
win_template:
@ -76,3 +92,9 @@
name: Telegraf
start_mode: auto
state: started
- name: "Windows | Cleanup"
win_file:
path: '{{ telegraf_win_install_dir }}\telegraf-{{ telegraf_agent_version }}'
state: absent
when: telegraf_agent_version is version('1.15', '>=')