# MetricBeat

```
  GNU nano 4.8                            metricbeat.yml                                       ---
- name: Install metric beat
  hosts: webservers
  become: true
  tasks:
    
  - name: Download metricbeat
    command: curl -L -O https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.6>
    
  - name: install metricbeat
    command: dpkg -i metricbeat-7.6.1-amd64.deb

    
  - name: drop in metricbeat config
    copy:
      src: /etc/ansible/files/metricbeat-config.yml
      dest: /etc/metricbeat/metricbeat.yml

    
  - name: enable and configure docker module for metric beat
    command: metricbeat modules enable docker

    
  - name: setup metric beat
    command: metricbeat setup

    
  - name: start metric beat
    command: service metricbeat start

    
  - name: enable service metricbeat on boot
    systemd:
      name: metricbeat
      enabled: yes
```