Skip to content
Snippets Groups Projects
Commit 78f83f3e authored by nimrod's avatar nimrod
Browse files

WIP installation and configuration.

parent 39e6b10f
No related branches found
No related tags found
No related merge requests found
--- ---
# defaults file for ansible-elasticsearch # defaults file for ansible-elasticsearch
elasticsearch_cors_domains: [ 'localhost', '*.{{ ansible_domain }}' ]
--- ---
# handlers file for ansible-elasticsearch # handlers file for ansible-elasticsearch
- name: Restart Elasticsearch
service:
name: elasticsearch
state: restarted
--- ---
# tasks file for ansible-elasticsearch # tasks file for ansible-elasticsearch
- name: Add apt repo key
apt_key:
url: https://packages.elastic.co/GPG-KEY-elasticsearch
state: present
- name: Add apt repo
apt_repository:
repo: deb http://packages.elastic.co/elasticsearch/2.x/debian stable main
state: present
update_cache: yes
- name: apt install
with_items:
- openjdk-7-jre-headless
- elasticsearch
apt:
name: '{{ item }}'
state: present
update_cache: yes
cache_valid_time: 3600
- name: Set Java options
lineinfile:
dest: /etc/default/elasticsearch
line: "ES_JAVA_OPTS='-Djava.net.preferIPv4Stack=true'"
regexp: '^ES_JAVA_OPTS='
state: present
notify:
- Restart Elasticsearch
- name: Copy configutation template
template:
src: elasticsearch.yml.j2
dest: /etc/elasticsearch/elasticsearch.yml
owner: root
group: root
mode: '0644'
notify:
- Restart Elasticsearch
- name: Enable, start Elasticsearch service
service:
name: elasticsearch
state: started
enabled: yes
{{ elasticsearch_config|to_nice_yaml }}
--- ---
# vars file for ansible-elasticsearch # vars file for ansible-elasticsearch
elasticsearch_config:
http.cors.enabled: true
'http.cors.allow-origin': '{{ elasticsearch_cors_domains }}'
indices.fielddata.cache.size: '50%'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment