Merge pull request #251 from wazuh/fix-upgrade-elk
Fix Ansible upgrade from 6.x to 7.x
This commit is contained in:
commit
9dbb5f415e
@ -38,7 +38,7 @@
|
||||
apt_repository:
|
||||
repo: 'deb https://artifacts.elastic.co/packages/7.x/apt stable main'
|
||||
state: present
|
||||
filename: 'elastic_repo'
|
||||
filename: 'elastic_repo_7'
|
||||
update_cache: true
|
||||
changed_when: false
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
- name: RedHat/CentOS/Fedora | Install Elastic repo
|
||||
yum_repository:
|
||||
name: elastic_repo
|
||||
name: elastic_repo_7
|
||||
description: Elastic repository for 7.x packages
|
||||
baseurl: https://artifacts.elastic.co/packages/7.x/yum
|
||||
gpgkey: https://artifacts.elastic.co/GPG-KEY-elasticsearch
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
apt_repository:
|
||||
repo: 'deb https://artifacts.elastic.co/packages/7.x/apt stable main'
|
||||
state: present
|
||||
filename: 'elastic_repo'
|
||||
filename: 'elastic_repo_7'
|
||||
update_cache: true
|
||||
changed_when: false
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: RedHat/CentOS/Fedora | Install Elastic repo
|
||||
yum_repository:
|
||||
name: elastic_repo
|
||||
name: elastic_repo_7
|
||||
description: Elastic repository for 7.x packages
|
||||
baseurl: https://artifacts.elastic.co/packages/7.x/yum
|
||||
gpgkey: https://artifacts.elastic.co/GPG-KEY-elasticsearch
|
||||
|
||||
@ -74,24 +74,27 @@
|
||||
tags: configure
|
||||
|
||||
- name: Checking Wazuh-APP version
|
||||
shell: |
|
||||
set -o pipefail
|
||||
grep -c -E 'version.*{{ elastic_stack_version }}' /usr/share/kibana/plugins/wazuh/package.json | xargs echo
|
||||
shell: >-
|
||||
grep -c -E 'version.*{{ elastic_stack_version }}' /usr/share/kibana/plugins/wazuh/package.json
|
||||
args:
|
||||
executable: /bin/bash
|
||||
removes: /usr/share/kibana/plugins/wazuh/package.json
|
||||
register: wazuh_app_verify
|
||||
changed_when: false
|
||||
tags: install
|
||||
failed_when:
|
||||
- wazuh_app_verify.rc != 0
|
||||
- wazuh_app_verify.rc != 1
|
||||
|
||||
- name: Removing old Wazuh-APP
|
||||
command: /usr/share/kibana/bin/kibana-plugin remove wazuh
|
||||
when: wazuh_app_verify.stdout == "0"
|
||||
command: /usr/share/kibana/bin/kibana-plugin --allow-root remove wazuh
|
||||
when: wazuh_app_verify.rc == 1
|
||||
tags: install
|
||||
|
||||
- name: Removing bundles
|
||||
file: path=/usr/share/kibana/optimize/bundles state=absent
|
||||
when: wazuh_app_verify.stdout == "0"
|
||||
become: yes
|
||||
become_user: kibana
|
||||
when: wazuh_app_verify.rc == 1
|
||||
tags: install
|
||||
|
||||
- name: Install Wazuh-APP (can take a while)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user