---
# This file will have been copied to the machine from the controller.
- name: copy logstash-public.crt
  copy:
    src: /tmp/logstash-{{ logstash_stack_name }}-public.crt
    dest: "{{ ssl_public_certs_path }}/logstash-public.crt"
    remote_src: yes
    mode: 0644

- name: copy filebeat configuration
  template:
    src: filebeat.yml.j2
    dest: /etc/filebeat/filebeat.yml
    owner: root
    group: root
    mode: 0644

- name: enable and start filebeat service
  systemd:
    name: filebeat
    enabled: yes
    state: restarted
