diff --git a/roles/telegraf/tasks/main.yml b/roles/telegraf/tasks/main.yml index 08b7036..2b07c60 100644 --- a/roles/telegraf/tasks/main.yml +++ b/roles/telegraf/tasks/main.yml @@ -1,25 +1,26 @@ # It would make sense to install the config file before the package, because the package # starts Telegraf post-install, and it would start with the default config file. However, # we want the config file to be owned by group 'telegraf', and it doesn't exist until the # package is installed. Running briefly with the default config shouldn't be harmful. # It won't be able to connect to InfluxDB anyway. - name: install Telegraf package apt: name: telegraf + state: latest - name: install Telegraf config template: src: telegraf.conf dest: /etc/telegraf/telegraf.conf owner: root group: telegraf mode: 0640 notify: reload telegraf tags: telegraf-config - name: start Telegraf on boot service: name: telegraf enabled: yes # auto-start on boot state: started