From d000d9616c2ea3bf62100eb9724090d098bca813 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Thu, 18 Apr 2019 12:02:09 -0700 Subject: [PATCH] Added ElasticSearch --- playbook/linux/elastic/elastic-7.x.list | 1 + .../linux/elastic/install-elasticsearch.yml | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 playbook/linux/elastic/elastic-7.x.list create mode 100644 playbook/linux/elastic/install-elasticsearch.yml diff --git a/playbook/linux/elastic/elastic-7.x.list b/playbook/linux/elastic/elastic-7.x.list new file mode 100644 index 0000000..7eef915 --- /dev/null +++ b/playbook/linux/elastic/elastic-7.x.list @@ -0,0 +1 @@ +deb https://artifacts.elastic.co/packages/7.x/apt stable main diff --git a/playbook/linux/elastic/install-elasticsearch.yml b/playbook/linux/elastic/install-elasticsearch.yml new file mode 100644 index 0000000..260c679 --- /dev/null +++ b/playbook/linux/elastic/install-elasticsearch.yml @@ -0,0 +1,40 @@ + + +- name: Install Elasticsearch + hosts: elastic + + tasks: + - name: Install Elastic GPG Key + become: true + apt_key: + url: "https://artifacts.elastic.co/GPG-KEY-elasticsearch" + state: present + id: 46095ACC8548582C1A2699A9D27D666CD88E42B4 + + - name: Install apt-transport-https + apt: + name: apt-transport-https + - name: Add Elastic Repo + become: true + copy: + src: elastic-7.x.list + dest: /etc/apt/sources.list.d/ + backup: yes + + - name: Update Packages + become: true + apt: + update_cache: true + + - name: Install ElasticSearch + become: true + apt: + name: elasticsearch + + - name: Start Service + systemd: + daemon_reload: yes + enabled: yes + name: elasticsearch + +