Skip to content

Instantly share code, notes, and snippets.

View z3ndrag0n's full-sized avatar

Barry W Anderson z3ndrag0n

  • Melbourne, Australia
View GitHub Profile
---
- name: Config Web VM metricbeat
hosts: webservers
become: true
tasks:
- name: Download and install metricbeat
apt:
deb: "https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-7.6.1-amd64.deb"
state: present
---
- name: Config Web VM filebeat
hosts: webservers
become: true
tasks:
- name: Download and install filebeat to the VM
apt:
deb: "https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.6.1-amd64.deb"
state: present
---
- name: Config ELK VM with Docker and the Elastic Stack
hosts: elk
become: true
tasks:
- name: docker.io
apt:
update_cache: yes
name: docker.io
state: present
Throws a KeyError 'sourcetype' exception.
Wrap in a try/except block - catch KeyError and assign 'bamboo' and raise from the default except.