---

filebeat_id: "{{ inventory_hostname }}-filebeat"

filebeat_docker: {
  services: [
    {
      name: "{{ filebeat_id }}",
      image_name: "{{ filebeat_image_name }}",
      image_version: "{{ filebeat_image_version }}",
      user: root,
      environment: [
        "node.name: \"{{ filebeat_id }}\"",
      ],
      volumes: [
        '"./config/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro"',
        '"/var/lib/docker/containers/:/var/lib/docker/containers/:ro"',
        '"/var/run/docker.sock:/var/run/docker.sock:ro"',
        '"/var/log/:/var/log/:ro"',
        '"./certs:/usr/share/filebeat/config/certificates:ro"',
      ],
      extra_hosts: "{{ filebeat_extra_hosts | default([]) }}",
    },
  ],
}
