diff --git a/states/telegraf/install.sls b/states/telegraf/install.sls index 6bb36c9..a175804 100644 --- a/states/telegraf/install.sls +++ b/states/telegraf/install.sls @@ -1,11 +1,12 @@ --- {%- from "telegraf/map.jinja" import telegraf with context %} +{% set archive_exclude_dir = './telegraf-' + telegraf.version %} 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 + - 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 - skip_verify: True - archive_format: tar - if_missing: {{ telegraf.release_dir }}/telegraf-{{ telegraf.version }}/telegraf