Skip to content

Commit

Permalink
Add filebeat functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
leifmadsen committed Aug 18, 2016
1 parent 48b3071 commit da8db23
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
16 changes: 16 additions & 0 deletions filebeat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# vim: ft=ansible
---

# Deploy Jenkins Master
- hosts: jenkins_master
tags:
- jenkins_master
- logging

vars_files:
- "{{ inventory_dir }}/../vars/main.yml"
- ~/.ansible/vars/cira_vars.yml

roles:
- { role: 'torian.filebeat' }

1 change: 1 addition & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
version: master
name: leifmadsen.jenkins-job-builder
- src: franklinkim.sudo
- src: torian.filebeat
3 changes: 3 additions & 0 deletions site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
# Include the ELK stack playbook
- include: elk.yml

# Include FileBeat setup
- include: filebeat.yml

# Section that provides post-installation information
- hosts: kibana
tags:
Expand Down
37 changes: 37 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Variables setup for use in site.yml run.
# Use host_vars/ or group_vars/ for openstack.yml setup.

# Jenkins Master Configuration
jenkins_master_server_name: ci.example.tld
jenkins_master_nginx_access_log: /var/log/nginx/jenkins.access.log
jenkins_master_ssh_directory: /var/lib/jenkins/.ssh/
Expand All @@ -15,18 +16,54 @@ jenkins_plugins:
- copy-to-slave
jenkins_scp_sites: []

# JJB Configuration
jenkins_job_builder_config_jenkins_url: http://localhost:8080
jenkins_job_builder_file_jobs_src: ./files/jobs
jenkins_job_builder_config_job_builder_recursive: True
jenkins_job_config_file_src: /var/lib/jenkins/userContent/config
jenkins_job_builder_handler_check_retries: 10

# Logstash Configuration
logstash_configuration_files:
- 03-beats.conf

# ElasticSearch configuration
elasticsearch_script_inline: false
elasticsearch_script_index: false
elasticsearch_http_port: 9200
elasticsearch_network_address: "{{ hostvars['elasticsearch']['ansible_eth0']['ipv4']['address'] }}"
elasticsearch_url: http://{{ elasticsearch_network_address }}:{{ elasticsearch_http_port }}
elasticsearch_network_host: 0.0.0.0

# FileBeat configuration
filebeat_user: root
filebeat_group: root
filebeat_create_user: false
filebeat_version: 1.2.3
filebeat_start_at_boot: true
filebeat_config_file: /etc/filebeat/filebeat.yml
filebeat_config_prospectors: |
filebeat:
prospectors:
-
paths:
- {{ jenkins_master_results_directory }}/**/**/job_*.log
input_type: log
document_type: "ansible"
include_lines: [ '(^PLAY RECAP.+)', '(^TASK.+)', '(^task path.+)', '(Monday)|(Tuesday)|(Wednesday)|(Thursday)|(Friday)|(Saturday)|(Sunday)', '(^ok\:.+)', '(^skipping\:.+)', '(^failed\:.+)', '(^included\:.+)', '(^changed\:.+)' ]
registry_file: "{{ filebeat_config_registry_file }}"
filebeat_config_output: |
output:
logstash:
hosts: ["{{ hostvars['logstash']['ansible_eth0']['ipv4']['address'] }}:5044"]
filebeat_config_logging: |
logging:
level: debug
to_files: true
to_syslog: false
files:
path: /var/log/mybeat
name: mybeat.log
keepfiles: 7

0 comments on commit da8db23

Please sign in to comment.