From 51d5e373109276ab94ddd5661d1592ce3cd77a0a Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 15 Feb 2016 14:22:08 +0100 Subject: [PATCH] library/roles/ELK: First parts of the new elasticsearch/logstash/kibana (ELK) roles. --- ELK/elasticsearch/defaults/main.yml | 9 +++++++++ ELK/elasticsearch/tasks/main.yml | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 ELK/elasticsearch/defaults/main.yml create mode 100644 ELK/elasticsearch/tasks/main.yml diff --git a/ELK/elasticsearch/defaults/main.yml b/ELK/elasticsearch/defaults/main.yml new file mode 100644 index 00000000..4ca5885c --- /dev/null +++ b/ELK/elasticsearch/defaults/main.yml @@ -0,0 +1,9 @@ +--- +elasticsearch_repo_key: https://packages.elastic.co/GPG-KEY-elasticsearch +elasticsearch_repo: 'deb http://packages.elastic.co/elasticsearch/2.x/debian stable main' +elasticsearch_packages: + - elasticsearch + +elasticsearch_cluster_name: 'Elasticsearch Cluster' +elasticsearch_enabled: True +elasticsearch_http_port: 9200 diff --git a/ELK/elasticsearch/tasks/main.yml b/ELK/elasticsearch/tasks/main.yml new file mode 100644 index 00000000..6a31af48 --- /dev/null +++ b/ELK/elasticsearch/tasks/main.yml @@ -0,0 +1,19 @@ +--- +- name: Install the elasticsearch repo key + apt_key: url={{ elasticsearch_repo_key }} state=present + tags: [ 'ELK', 'elasticsearch', 'elk' ] + +- name: Install the elasticsearch deb repository + apt_repository: repo='{{ elasticsearch_repo }}' state=present update_cache=yes + tags: [ 'ELK', 'elasticsearch', 'elk' ] + +- name: Install the elasticsearch deb packages + apt: name='{{ item }}' state=present + with_items: '{{ elasticsearch_packages }}' + tags: [ 'ELK', 'elasticsearch', 'elk' ] + +- name: Ensure that elasticsearch is enabled and running + service: name=elasticsearch state=started enabled=yes + when: elasticsearch_enabled + tags: [ 'ELK', 'elasticsearch', 'elk' ] +