2020-07-10 00:58:55 +02:00
|
|
|
---
|
|
|
|
{%- from "telegraf/map.jinja" import telegraf with context %}
|
2020-08-16 15:01:47 +02:00
|
|
|
{% set archive_exclude_dir = './telegraf-' + telegraf.version %}
|
2020-07-10 00:58:55 +02:00
|
|
|
telegraf-archive-extract:
|
|
|
|
archive.extracted:
|
|
|
|
- name: {{ telegraf.release_dir }}/telegraf-{{ telegraf.version }}
|
|
|
|
- source: {{ telegraf.mirror }}/telegraf-{{ telegraf.version }}_{{ salt['grains.get']('kernel')|lower }}_{{ salt['grains.get']('osarch') }}.tar.gz
|
|
|
|
- enforce_toplevel: False
|
2020-08-16 15:01:47 +02:00
|
|
|
- options: --transform 's|^\{{ archive_exclude_dir }}|/|g' --exclude '{{ archive_exclude_dir }}/etc' --exclude '{{ archive_exclude_dir }}/usr/lib' --exclude '{{ archive_exclude_dir }}/var' --strip 2
|
2020-07-10 00:58:55 +02:00
|
|
|
- skip_verify: True
|
|
|
|
- archive_format: tar
|
|
|
|
- if_missing: {{ telegraf.release_dir }}/telegraf-{{ telegraf.version }}/telegraf
|
2020-07-20 13:14:13 +02:00
|
|
|
- watch_in:
|
|
|
|
- service: telegraf-service
|
2020-07-10 00:58:55 +02:00
|
|
|
|
|
|
|
telegraf-bin-symlink:
|
|
|
|
file.symlink:
|
|
|
|
- name: /usr/local/bin/telegraf
|
|
|
|
- target: {{ telegraf.release_dir }}/telegraf-{{ telegraf.version }}/telegraf
|
2020-07-20 13:14:13 +02:00
|
|
|
- watch_in:
|
|
|
|
- service: telegraf-service
|
2020-07-10 00:58:55 +02:00
|
|
|
|
|
|
|
telegraf-defaults-file:
|
|
|
|
file.managed:
|
|
|
|
- name: /etc/default/telegraf
|
|
|
|
- source: salt://telegraf/telegraf_default.j2
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- template: jinja
|
|
|
|
- watch_in:
|
2020-07-20 13:14:13 +02:00
|
|
|
- service: telegraf-service
|