Merge pull request #651 from wazuh/650-roles-opendistro

Improve tasks in Opendistro
This commit is contained in:
Gonzalo Acuña 2021-10-19 12:59:44 -03:00 committed by GitHub
commit a17ef98093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 13 deletions

View File

@ -1,20 +1,32 @@
---
#- name: Install OpenDistro dependencies
# apt:
# name: [
# 'unzip', 'wget', 'curl',
# 'apt-transport-https', software-properties-common
# ]
# state: present
- name: Update cache
apt:
update_cache: yes
- name: Add openjdk repository
- name: Debian 9 (Stretch)
when: (ansible_facts['distribution'] == "Debian" and ansible_facts['distribution_major_version'] == "9")
block:
- name: Install OpenDistro dependencies
apt:
name: [
'unzip', 'wget', 'curl', 'apt-transport-https', software-properties-common
]
state: present
- name: Add the repository key for Debian's Stretch Backports repository
ansible.builtin.apt_key:
keyserver: keyserver.ubuntu.com
id: 648ACFD622F3D138
- name: Add openjdk repository
apt_repository:
repo: "{{ package_repos.apt.openjdk.baseurl }}"
state: present
update_cache: yes
when: (ansible_facts['distribution'] == "Debian" and ansible_facts['distribution_major_version'] == "9")
filename: 'wazuh-openjdk'
- name: Install openjdk-11-jdk
apt:
@ -34,6 +46,7 @@
apt_repository:
repo: "{{ package_repos.apt.opendistro.baseurl }}"
state: present
filename: 'wazuh-opendistro'
update_cache: yes
- name: Install OpenDistro

View File

@ -14,9 +14,13 @@
- name: Remove performance analyzer plugin from elasticsearch
become: true
command: ./elasticsearch-plugin remove opendistro-performance-analyzer
ignore_errors: true
args:
chdir: /usr/share/elasticsearch/bin/
register: remove_elasticsearch_performance_analyzer
failed_when:
- remove_elasticsearch_performance_analyzer.rc != 0
- '"not found" not in remove_elasticsearch_performance_analyzer.stderr'
changed_when: "remove_elasticsearch_performance_analyzer.rc == 0"
- name: Remove elasticsearch configuration file
file: