5c10c12a37
Heartbeat has been enabled which will allow us to check the uptime of hosts and services. Stack updates have been made to correct a couple templating issues and reduce template sizes by using includes where we have common config. Change-Id: I47e32ac4b4ce8ca3ea572d8384660011af7cde6a Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
67 lines
1.8 KiB
YAML
67 lines
1.8 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 }}"
|
|
when:
|
|
- physical_host != inventory_hostname
|
|
- container_tech | default('lxc') == 'lxc'
|
|
|
|
- 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: Ensure elasticsearch ownership
|
|
file:
|
|
path: /var/lib/elasticsearch
|
|
owner: elasticsearch
|
|
group: elasticsearch
|
|
recurse: true
|
|
|
|
- name: Enable and restart elastic
|
|
systemd:
|
|
name: "elasticsearch"
|
|
enabled: true
|
|
state: restarted
|
|
tags:
|
|
- config
|