2021-11-27 20:29:59 +01:00
|
|
|
- name: "elastic | Hole Paket"
|
|
|
|
get_url:
|
|
|
|
url: "{{ es_url }}"
|
2021-11-27 21:09:09 +01:00
|
|
|
dest: "{{ es_dl_path }}"
|
2022-02-15 13:15:16 +01:00
|
|
|
when: "'elasticsearch-oss' not in ansible_facts.packages"
|
2021-11-27 20:29:59 +01:00
|
|
|
|
|
|
|
- name: "elastic | Installiere Paket"
|
|
|
|
command: "dpkg -i elasticsearch-oss-{{ es_version }}-amd64.deb"
|
|
|
|
args:
|
|
|
|
chdir: "{{ es_dl_path }}"
|
2022-02-15 13:15:16 +01:00
|
|
|
when: "'elasticsearch-oss' not in ansible_facts.packages"
|
2021-11-27 20:29:59 +01:00
|
|
|
|
|
|
|
- name: "elastic | Prüfe Plugin"
|
|
|
|
stat:
|
|
|
|
path: /usr/share/elasticsearch/plugins/ingest-attachment
|
|
|
|
register: ingest_plugin
|
|
|
|
|
2022-02-15 13:15:16 +01:00
|
|
|
# https://www.elastic.co/guide/en/elasticsearch/plugins/current/installation.html
|
|
|
|
# Installiert die zur ES passende Plugin-Version - 7.10.2 (OSS)
|
2021-11-27 20:29:59 +01:00
|
|
|
- name: "eleastic | Installiere Plugin"
|
2022-02-15 13:15:16 +01:00
|
|
|
command: elasticsearch-plugin install ingest-attachment --batch
|
2021-11-27 20:29:59 +01:00
|
|
|
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'
|
|
|
|
|
2021-12-11 18:25:52 +01:00
|
|
|
- name: "elastic | Kopiere Fix für CVE-2021-44228"
|
|
|
|
copy:
|
|
|
|
src: nolog4j0day.options
|
|
|
|
dest: /etc/elasticsearch/jvm.options.d/nolog4j0day.options
|
|
|
|
|
2021-11-27 20:29:59 +01:00
|
|
|
- name: "elastic | Starte Dienst"
|
|
|
|
systemd:
|
|
|
|
name: elasticsearch
|
|
|
|
state: started
|
|
|
|
daemon_reload: yes
|
|
|
|
|
|
|
|
- name: "elastic | Konfiguriere ES-Server-Adresse"
|
|
|
|
shell:
|
2022-11-22 15:24:48 +01:00
|
|
|
cmd: rbenv exec bundle exec rails r "Setting.set('es_url', 'http://127.0.0.1:9200')"
|
2021-11-27 20:29:59 +01:00
|
|
|
chdir: "{{ zammad_home }}"
|
|
|
|
environment:
|
|
|
|
RAILS_ENV: production
|
2021-11-27 21:09:09 +01:00
|
|
|
become: true
|
|
|
|
become_user: "{{ zammad_user }}"
|
2021-11-27 20:29:59 +01:00
|
|
|
|
|
|
|
- name: "elastic | Erstelle Such-Index"
|
|
|
|
shell:
|
2022-11-22 15:24:48 +01:00
|
|
|
cmd: rbenv exec bundle exec rake zammad:searchindex:rebuild
|
2021-11-27 20:29:59 +01:00
|
|
|
chdir: "{{ zammad_home }}"
|
|
|
|
environment:
|
|
|
|
RAILS_ENV: production
|
2021-11-27 21:09:09 +01:00
|
|
|
become: true
|
|
|
|
become_user: "{{ zammad_user }}"
|
2021-11-28 16:13:57 +01:00
|
|
|
|
|
|
|
- name: "elastic | Konfiguriere Datei-Erweiterungen"
|
|
|
|
shell:
|
2022-11-22 15:24:48 +01:00
|
|
|
cmd: rbenv exec bundle exec rails r "Setting.set('es_attachment_ignore', [ '.png', '.jpg', '.jpeg', '.mpeg', '.mpg', '.mov', '.bin', '.exe', '.box', '.mbox' ] )"
|
2021-11-28 16:13:57 +01:00
|
|
|
chdir: "{{ zammad_home }}"
|
|
|
|
environment:
|
|
|
|
RAILS_ENV: production
|
|
|
|
become: true
|
|
|
|
become_user: "{{ zammad_user }}"
|
|
|
|
|
|
|
|
- name: "elastic | Konfiguriere Datei-Größen"
|
|
|
|
shell:
|
2022-11-22 15:24:48 +01:00
|
|
|
cmd: rbenv exec bundle exec rails r "Setting.set('es_attachment_max_size_in_mb', {{ es_attachment_max_size }})"
|
2021-11-28 16:13:57 +01:00
|
|
|
chdir: "{{ zammad_home }}"
|
|
|
|
environment:
|
|
|
|
RAILS_ENV: production
|
|
|
|
become: true
|
|
|
|
become_user: "{{ zammad_user }}"
|
2022-03-23 14:47:38 +01:00
|
|
|
|
|
|
|
- name: "elastic | Richte Monit-Überwachung ein"
|
|
|
|
copy:
|
|
|
|
src: elasticsearch.monit
|
|
|
|
dest: /etc/monit/conf-enabled/elasticsearch
|
|
|
|
notify: reload monit
|