Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ansible upgrade from 6.x to 7.x #251

Merged
merged 4 commits into from
Sep 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion roles/elastic-stack/ansible-elasticsearch/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion roles/elastic-stack/ansible-elasticsearch/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion roles/elastic-stack/ansible-kibana/tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion roles/elastic-stack/ansible-kibana/tasks/RedHat.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 10 additions & 7 deletions roles/elastic-stack/ansible-kibana/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down