31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
---
|
|
{%- from "telegraf/map.jinja" import telegraf with context %}
|
|
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
|
|
- options: --transform 's|^\./telegraf|/|g' --exclude './telegraf/etc' --exclude './telegraf/usr/lib' --exclude './telegraf/var' --strip 2
|
|
- skip_verify: True
|
|
- archive_format: tar
|
|
- if_missing: {{ telegraf.release_dir }}/telegraf-{{ telegraf.version }}/telegraf
|
|
- watch_in:
|
|
- service: telegraf-service
|
|
|
|
telegraf-bin-symlink:
|
|
file.symlink:
|
|
- name: /usr/local/bin/telegraf
|
|
- target: {{ telegraf.release_dir }}/telegraf-{{ telegraf.version }}/telegraf
|
|
- watch_in:
|
|
- service: telegraf-service
|
|
|
|
telegraf-defaults-file:
|
|
file.managed:
|
|
- name: /etc/default/telegraf
|
|
- source: salt://telegraf/telegraf_default.j2
|
|
- user: root
|
|
- group: root
|
|
- template: jinja
|
|
- watch_in:
|
|
- service: telegraf-service
|