This commit is contained in:
zhangzhihan
2020-01-17 15:35:48 +08:00
commit 960bdaa91f
58 changed files with 7988 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
- name: "copy telegraf.rpm to destination server"
copy:
src: "{{ role_path }}/files/"
dest: /tmp
- name: "install telegraf"
yum:
name:
- /tmp/telegraf-1.11.4-1.x86_64.rpm
state: present
- name: "bak original telegraf.conf"
shell: cd /etc/telegraf;mv telegraf.conf telegraf.conf_original
- name: "Templates telegraf.conf"
template:
src: "{{role_path}}/templates/telegraf.conf.j2"
dest: /etc/telegraf/
tags: template
- name: "Start telegraf"
systemd:
name: telegraf.service
state: started
enabled: yes