---

metricbeat_id: "{{ inventory_hostname }}-metricbeat"

metricbeat_docker: {
  services: [
    {
      name: "{{ metricbeat_id }}",
      image_name: "{{ metricbeat_image_name }}",
      image_version: "{{ metricbeat_image_version }}",
      user: root,
      environment: [
        "node.name: \"{{ metricbeat_id }}\"",
      ],
      volumes: [
        '"./config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro"',
        '"/var/run/docker.sock:/var/run/docker.sock:ro"',
        '"/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro"',
        '"/proc:/hostfs/proc:ro"',
        '"/:/hostfs:ro"',
        '"./certs:/usr/share/metricbeat/config/certificates:ro"',
      ],
      extra_hosts: "{{ metricbeat_extra_hosts | default([]) }}",
    },
  ],
}
