75 lines
No EOL
2 KiB
YAML
75 lines
No EOL
2 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
|
|
state: latest
|
|
update_cache: yes
|
|
|
|
- name: Set config file
|
|
template:
|
|
src: elasticsearch.yml.j2
|
|
dest: /etc/elasticsearch/elasticsearch.yml
|
|
owner: root
|
|
group: elasticsearch
|
|
|
|
- name: Ensure elasticsearch is running
|
|
service:
|
|
name: elasticsearch
|
|
state: started
|
|
|
|
- name: Remove ingest-attachment plugin if installed
|
|
shell:
|
|
cmd: "{{ nextcloud_elasticsearch_bin_dir }}/elasticsearch-plugin remove ingest-attachment"
|
|
ignore_errors: yes
|
|
|
|
- name: Install ingest-attachment plugin
|
|
shell:
|
|
cmd: "{{ nextcloud_elasticsearch_bin_dir }}/elasticsearch-plugin install ingest-attachment"
|
|
|
|
- name: Restart elasticsearch
|
|
service:
|
|
name: elasticsearch
|
|
state: restarted
|
|
enabled: yes
|
|
daemon_reload: yes |