create
This commit is contained in:
25
roles/telegraf/tasks/main.yml
Normal file
25
roles/telegraf/tasks/main.yml
Normal 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
|
||||
Reference in New Issue
Block a user