60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
- name: "elastic | Hole Paket"
|
|
get_url:
|
|
url: "{{ es_url }}"
|
|
dest: "{{ es_dl_path }}"
|
|
when: "'elasticsearch-oss' in ansible_facts.packages == False"
|
|
|
|
- name: "elastic | Installiere Paket"
|
|
command: "dpkg -i elasticsearch-oss-{{ es_version }}-amd64.deb"
|
|
args:
|
|
chdir: "{{ es_dl_path }}"
|
|
when: "'elasticsearch-oss' in ansible_facts.packages == False"
|
|
|
|
- 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 }}"
|
|
dest: "{{ 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
|
|
become: true
|
|
become_user: "{{ zammad_user }}"
|
|
|
|
- name: "elastic | Erstelle Such-Index"
|
|
shell:
|
|
cmd: rbenv exec rake searchindex:rebuild
|
|
chdir: "{{ zammad_home }}"
|
|
environment:
|
|
RAILS_ENV: production
|
|
become: true
|
|
become_user: "{{ zammad_user }}"
|