elasticsearch_nextcloud/tasks/main.yml
2023-01-22 20:14:05 +01:00

58 lines
No EOL
1.6 KiB
YAML

---
- name: Set OS dependent variables
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
- "{{ ansible_system | lower }}.yml"
paths:
- '{{ role_path }}/vars'
ignore_errors: True
- name: OS is supported
ansible.builtin.assert:
that: __os_supported
quiet: True
vars:
__os_supported: "{{ lookup('vars', '{}_os_supported'.format(role_name)) | bool }}"
- name: Add elasticsearch GPG key
shell:
cmd: "wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - "
- name: Install apt-transport-https
apt:
pkg:
- apt-transport-https
state: latest
update_cache: yes
- name: Add elasticsearch repo to sources
copy:
content: "deb https://artifacts.elastic.co/packages/6.x/apt stable main"
dest: "/etc/apt/sources.list.d/elastic-6.x.list"
owner: root
group: root
- name: Install packages
apt:
pkg:
- default-jre
- elasticsearch=6.1.0
state: latest
update_cache: yes
- name: Set config file
template:
src: elasticsearch.yml.j2
dest: /etc/elasticsearch/elasticsearch.yml
owner: root
group: elasticsearch
- name: Enable ingest-attachment plugin
shell:
cmd: "{{ nextcloud_elasticsearch_bin_dir }}/elasticsearch-plugin install ingest-attachment"