roles/wazuh_manager: merge uninstall tasks in a single file

This commit is contained in:
neonmei 2020-11-09 14:04:55 -03:00
parent d44532482a
commit 0f6ea26123
No known key found for this signature in database
GPG Key ID: 7EA1832E7E17237E
4 changed files with 18 additions and 22 deletions

View File

@ -1,6 +0,0 @@
---
- name: Debian/Ubuntu | Remove Wazuh repository.
apt_repository:
repo: deb https://packages.wazuh.com/apt {{ ansible_distribution_release }} main
state: absent
changed_when: false

View File

@ -1,7 +0,0 @@
---
- name: RedHat/CentOS/Fedora | Remove Wazuh repository (and clean up left-over metadata)
yum_repository:
name: wazuh_repo
state: absent
changed_when: false

View File

@ -321,12 +321,6 @@
- ( agent_groups is defined) and ( agent_groups|length > 0)
tags: molecule-idempotence-notest
- include_tasks: "RMRedHat.yml"
when:
- ansible_os_family == "RedHat" or ansible_os_family == "Amazon"
- not wazuh_manager_sources_installation.enabled
- include_tasks: "RMDebian.yml"
when:
- ansible_os_family == "Debian"
- not wazuh_manager_sources_installation.enabled
- name: Run uninstall tasks
include_tasks: uninstall.yml
when: not wazuh_manager_sources_installation.enabled

View File

@ -0,0 +1,15 @@
---
- name: Debian/Ubuntu | Remove Wazuh repository.
apt_repository:
repo: deb https://packages.wazuh.com/apt {{ ansible_distribution_release }} main
state: absent
changed_when: false
when: not wazuh_manager_sources_installation.enabled
- name: RedHat/CentOS/Fedora | Remove Wazuh repository (and clean up left-over metadata)
yum_repository:
name: wazuh_repo
state: absent
changed_when: false
when: ansible_os_family == "RedHat" or ansible_os_family == "Amazon"