Skip to content
This repository has been archived by the owner on Nov 1, 2018. It is now read-only.

Commit

Permalink
#15 installation working, no config just yet
Browse files Browse the repository at this point in the history
  • Loading branch information
donsizemore committed Mar 8, 2016
1 parent f70520f commit fab7bcf
Show file tree
Hide file tree
Showing 29 changed files with 1,394 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ansible/playbooks/elasticsearch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

- hosts: elk
sudo: yes
roles:
- elk-data
- elk-elasticsearch
6 changes: 6 additions & 0 deletions ansible/playbooks/filebeat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

- hosts: systems
sudo: yes
roles:
- support-filebeat
14 changes: 14 additions & 0 deletions ansible/playbooks/logstash.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- hosts: elk
become: true
vars:
logstash_install: "true"
logstash_elasticsearch_host: "localhost:9200"
logstash_plugins:
- plugin: logstash-input-beats
- plugin: logstash-output-elasticsearch
logstash_version: "2.2"
logstash_base_dir: "/opt/logstash"
logstash_cfg_dir: "/etc/logstash/conf.d"
logstash_clean_cfg_dir: true
roles:
- role: support-logstash-cfg
43 changes: 43 additions & 0 deletions ansible/roles/elk-data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Elk-Data
=========

For deploying the service definitions for the ELK data container.

Future features may be ES index management tasks

All elastic search and kibana data is held in the data container. Executing
this role _should not_ destroy any data that is already in the data container.

Requirements
------------

systemd

Role Variables
--------------

TBD

Dependencies
------------

N/A

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
roles:
- { role: username.rolename, x: 42 }

License
-------

BSD

Author Information
------------------

Jonathan Strootman, [email protected]
3 changes: 3 additions & 0 deletions ansible/roles/elk-data/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# defaults file for elk-data
enable_services: yes
44 changes: 44 additions & 0 deletions ansible/roles/elk-data/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# tasks file for elk-data
- name: pull elk images
shell: docker pull {{ elk.data.image_name }}
register: docker_pull_v
changed_when: docker_pull_v.stdout.find('Image is up to date') == -1
tags:
- docker_pull
- docker_pull_elk_data

- name: place Systemd service files
template: src={{ elk.data.service_name }} dest=/usr/lib/systemd/system group=root owner=root mode=0664
register: service_file_v
tags:
- update_service_files
- update_service_files_elk_data

- name: Reload systemd
shell: systemctl daemon-reload
when: service_file_v.changed
tags:
- update_service_files
- update_service_files_elk_data

- name: enable elk data service
service: name={{elk.data.service_name}} enabled={{enable_services}}
when: service_file_v.changed
tags:
- enable_services
- enable_data

- name: Container exists
shell: "docker ps -aq -f 'name={{elk.data.container_name}}'"
register: container_exists
changed_when: container_exists.stdout == ""

# Only restart if container doesn't exist.
- name: restart elk data service
service: name={{elk.data.service_name}} state=restarted
when: container_exists.changed
tags:
- restart_services
- restart_data

12 changes: 12 additions & 0 deletions ansible/roles/elk-data/templates/elk-data.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description={{elk.data.service_description}}
BindsTo=docker.service
PartOf=docker.service
After=docker.service
Requisite=docker.service

[Service]
Type=oneshot
ExecStart=-/usr/bin/docker run --name {{elk.data.container_name}} -v /usr/share/elasticsearch/data/ {{elk.data.image_name}}

SyslogIdentifier=elk-data
38 changes: 38 additions & 0 deletions ansible/roles/elk-kibana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Elk-Kibana
=========

For deploying and configuring the Kibana instance for the DE ELK stack.

Requirements
------------

systemd

Role Variables
--------------

TBD

Dependencies
------------

N/A

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: servers
roles:
- { role: username.rolename, x: 42 }

License
-------

BSD

Author Information
------------------

Jonathan Strootman, [email protected]
3 changes: 3 additions & 0 deletions ansible/roles/elk-kibana/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
# defaults file for elk-kibana
enable_services: yes
9 changes: 9 additions & 0 deletions ansible/roles/elk-kibana/files/d1-top-25-user-activity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"title": "Top 25 User Activity",
"description": "",
"panelsJSON": "[{\"col\":1,\"id\":\"Top-25-Users-by-App-Submission\",\"row\":1,\"size_x\":4,\"size_y\":4,\"type\":\"visualization\"},{\"col\":1,\"id\":\"Top-25-Users-by-Login\",\"row\":5,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"},{\"col\":7,\"id\":\"Top-25-Users-by-Sharing-Activity\",\"row\":5,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"},{\"col\":5,\"id\":\"Top-25-Launched-Apps\",\"row\":1,\"size_x\":4,\"size_y\":4,\"type\":\"visualization\"},{\"id\":\"Total-Public-App-Submissions\",\"type\":\"visualization\",\"size_x\":3,\"size_y\":2,\"col\":9,\"row\":1},{\"id\":\"Total-Public-slash-Private-App-Submissions\",\"type\":\"visualization\",\"size_x\":3,\"size_y\":2,\"col\":9,\"row\":3}]",
"timeRestore": false,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[{\"query\":{\"query_string\":{\"query\":\"*\",\"analyze_wildcard\":true}}}]}"
}
}
2 changes: 2 additions & 0 deletions ansible/roles/elk-kibana/files/i0-default-index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"defaultIndex":"de-logs"}

Loading

0 comments on commit fab7bcf

Please sign in to comment.