openstack-ansible-ops/elk_metrics_6x/installElastic.yml
Kevin Carter 17fb37f075
Update elk 6.x playbooks
Most of the changes in this PR are for style and to adapt the playbooks
so that the system can operate on a multi-node cloud.

Functional change includes the removal of mainline Java 8 in favor of
OpenJDK 8.

A site playbook was add to allow an operator to just run everything.

Old tools that no longer function within the stack have been removed.

Packetbeat was added to the install list
Auditbeat was added to the install list

All of the config files have been updated for the recent ElasticStack
6.x changes.

Change-Id: I01200ad4772ff200b9c5c93f8f121145dfb88170
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-04-11 03:11:44 -05:00

55 lines
1.5 KiB
YAML

---
- name: Install Elastic Search
hosts: "elastic-logstash"
become: true
vars_files:
- vars/variables.yml
tasks:
- name: Configure systcl vm.max_map_count=262144 on container hosts
sysctl:
name: "vm.max_map_count"
value: "262144"
state: "present"
reload: "yes"
delegate_to: "{{ physical_host }}"
tags:
- sysctl
- name: elasticsearch datapath bind mount
lxc_container:
name: "{{ inventory_hostname }}"
container_command: |
[[ ! -d "/var/lib/elasticsearch" ]] && mkdir -p "/var/lib/elasticsearch"
[[ ! -d "/var/lib/elasticsearch-olddata" ]] && mkdir -p "/var/lib/elasticsearch-olddata"
container_config:
- "lxc.mount.entry=/openstack/{{ inventory_hostname }} var/lib/elasticsearch none bind 0 0"
delegate_to: "{{ physical_host }}"
- name: Ensure Java is installed
apt:
name: openjdk-8-jre
state: present
install_recommends: yes
update_cache: yes
- include_tasks: common_task_install_elk_repo.yml
- name: Ensure Elastic search is installed.
apt:
name: elasticsearch
state: present
update_cache: yes
- name: Drop elastic search conf file
template:
src: templates/elasticsearch.yml.j2
dest: /etc/elasticsearch/elasticsearch.yml
tags:
- config
- name: Enable and restart elastic
systemd:
name: "elasticsearch"
enabled: true
state: restarted
tags:
- config