--- # 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' - 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