filebeat/playbooks/roles/supervisor/tasks/main.yml

41 lines
983 B
YAML
Raw Normal View History

2021-11-08 17:01:14 +08:00
---
# tasks file for supervisor
- name: Install Supervisor
ansible.builtin.pip:
name: supervisor
executable: "{{ pip_bin_path }}"
- name: Render Supervisor Configure File
ansible.builtin.template:
src: supervisor.yml
dest: "{{ work_path }}/supervisor.yml"
owner: root
group: root
mode: '0750'
vars:
items: "{{ filebeat_configs }}"
2021-11-08 17:01:14 +08:00
- name: Render Supervisor SystemV Script
ansible.builtin.template:
src: supervisor.sh
dest: "{{ work_path }}/supervisor_initd.sh"
owner: root
group: root
mode: '0750'
vars:
config_file_path: "{{ work_path }}/supervisor.yml"
- name: Symlink SystemV Script
ansible.builtin.file:
src: "{{ work_path }}/supervisor_initd.sh"
dest: "/etc/init.d/filebeat_{{ instance_name }}"
owner: "root"
state: link
- name: Start Filebeat Service
ansible.builtin.service:
name: "filebeat_{{ instance_name }}"
state: restarted
enabled: true
sleep: 30
use: sysvinit