Installation und Einrichtung von ES

This commit is contained in:
phil 2021-11-27 20:29:59 +01:00
parent 09f8e98ac6
commit fba2a88ca4
2 changed files with 76 additions and 0 deletions

54
tasks/elastic.yml Normal file
View file

@ -0,0 +1,54 @@
- name: "elastic | Hole Paket"
get_url:
url: "{{ es_url }}"
path: "{{ es_dl_path }}"
- name: "elastic | Installiere Paket"
command: "dpkg -i elasticsearch-oss-{{ es_version }}-amd64.deb"
args:
chdir: "{{ es_dl_path }}"
- name: "elastic | Prüfe Plugin"
stat:
path: /usr/share/elasticsearch/plugins/ingest-attachment
register: ingest_plugin
- name: "elastic | Hole Plugin"
get_url:
url: "{{ es_ingest_attachment_url }}"
path: "{{ es_dl_path }}"
when: ingest_plugin.stat.exists == False
- name: "eleastic | Installiere Plugin"
command: "elasticsearch-plugin install file:///{{ es_dl_path }}/ingest-attachment-{{ es_ingest_attachment_version }}.zip"
args:
chdir: /usr/share/elasticsearch/bin
when: ingest_plugin.stat.exists == False
- name: "elastic | Passe Konfiguration an"
lineinfile:
path: /etc/elasticsearch/elasticsearch.yml
line: "{{ item }}"
loop:
- 'http.max_content_length: 400mb'
- 'indices.query.bool.max_clause_count: 2000'
- name: "elastic | Starte Dienst"
systemd:
name: elasticsearch
state: started
daemon_reload: yes
- name: "elastic | Konfiguriere ES-Server-Adresse"
shell:
cmd: rbenv exec rails r "Setting.set('es_url', 'http://127.0.0.1:9200')"
chdir: "{{ zammad_home }}"
environment:
RAILS_ENV: production
- name: "elastic | Erstelle Such-Index"
shell:
cmd: rbenv exec rake searchindex:rebuild
chdir: "{{ zammad_home }}"
environment:
RAILS_ENV: production

View file

@ -1,15 +1,37 @@
- import_tasks: packages.yml
tags: packages
- import_tasks: locales.yml
tags: locales
- import_tasks: user.yml
tags: user
- import_tasks: zammad.yml
tags: zammad
- import_tasks: ruby.yml
tags: ruby
- import_tasks: database.yml
tags: database
- import_tasks: syslog.yml
tags: syslog
- import_tasks: webserver.yml
tags: webserver
- import_tasks: systemd.yml
tags: systemd
- import_tasks: monit.yml
tags: monit
- import_tasks: gateway.yml
tags: gateway
- name: Elastic
include_tasks: elastic.yml
when: "'elasticsearch-oss' in ansible_facts.packages == False"
tags: elastic