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