26 lines
558 B
YAML
26 lines
558 B
YAML
- 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
|