增加telegraf collect 部署
This commit is contained in:
29
roles/telegraf_collect/tasks/main.yml
Normal file
29
roles/telegraf_collect/tasks/main.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
- name: "copy telegraf.rpm to destination server"
|
||||
copy:
|
||||
src: "{{ role_path }}/files/telegraf-1.13.0-1.x86_64.rpm"
|
||||
dest: /tmp
|
||||
|
||||
- name: "install telegraf"
|
||||
yum:
|
||||
name:
|
||||
- /tmp/telegraf-1.13.0-1.x86_64.rpm
|
||||
state: present
|
||||
|
||||
- name: "Templates telegraf_collect.conf"
|
||||
template:
|
||||
src: "{{role_path}}/templates/telegraf_collect.conf.j2"
|
||||
dest: /etc/telegraf/telegraf_collect.conf
|
||||
tags: template
|
||||
|
||||
- name: "copy telegraf_collect.service to destination server"
|
||||
copy:
|
||||
src: "{{ role_path }}/files/telegraf_collect.service"
|
||||
dest: /usr/lib/systemd/system
|
||||
mode: 0755
|
||||
|
||||
- name: "Start telegraf_collect"
|
||||
systemd:
|
||||
name: telegraf_collect
|
||||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
Reference in New Issue
Block a user