Fix cleanup tasks for Wazuh Manager and Agent

This commit is contained in:
Jose M 2019-11-25 18:54:21 +01:00
parent c9c00b82c2
commit fa0e3f1640
2 changed files with 24 additions and 16 deletions

View File

@ -11,12 +11,14 @@
state: present state: present
- name: Removing old files - name: Removing old files
file: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz" file:
state: absent path: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz"
state: absent
- name: Removing old folders - name: Removing old folders
file: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}" file:
state: absent path: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}"
state: absent
- name: Installing policycoreutils-python (RedHat families) - name: Installing policycoreutils-python (RedHat families)
package: package:
@ -86,9 +88,11 @@
chdir: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}" chdir: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}"
- name: Cleanup downloaded files - name: Cleanup downloaded files
file: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz" file:
state: absent path: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz"
state: absent
- name: Cleanup created folders - name: Cleanup created folders
file: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}" file: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz"
state: absent path: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}"
state: absent

View File

@ -19,12 +19,14 @@
state: present state: present
- name: Removing old files - name: Removing old files
file: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz" file:
state: absent path: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz"
state: absent
- name: Removing old folders - name: Removing old folders
file: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}" file:
state: absent path: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}"
state: absent
- name: Installing policycoreutils-python (RedHat families) - name: Installing policycoreutils-python (RedHat families)
package: package:
@ -98,12 +100,14 @@
chdir: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}" chdir: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}"
- name: Cleanup downloaded files - name: Cleanup downloaded files
file: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz" file:
state: absent path: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz"
state: absent
- name: Cleanup created folders - name: Cleanup created folders
file: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}" file:
state: absent path: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}"
state: absent
when: when:
- not wazuh_ossec_control.stat.exists - not wazuh_ossec_control.stat.exists