From fa0e3f16408af2497792eb25998eb5d3d322d8af Mon Sep 17 00:00:00 2001 From: Jose M Date: Mon, 25 Nov 2019 18:54:21 +0100 Subject: [PATCH] Fix cleanup tasks for Wazuh Manager and Agent --- .../tasks/installation_from_sources.yml | 20 +++++++++++-------- .../tasks/installation_from_sources.yml | 20 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/roles/wazuh/ansible-wazuh-agent/tasks/installation_from_sources.yml b/roles/wazuh/ansible-wazuh-agent/tasks/installation_from_sources.yml index 2b29a682..b13c17ef 100644 --- a/roles/wazuh/ansible-wazuh-agent/tasks/installation_from_sources.yml +++ b/roles/wazuh/ansible-wazuh-agent/tasks/installation_from_sources.yml @@ -11,12 +11,14 @@ state: present - name: Removing old files - file: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz" - state: absent + file: + path: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz" + state: absent - name: Removing old folders - file: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}" - state: absent + file: + path: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}" + state: absent - name: Installing policycoreutils-python (RedHat families) package: @@ -86,9 +88,11 @@ chdir: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}" - name: Cleanup downloaded files - file: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz" - state: absent + file: + path: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz" + state: absent - name: Cleanup created folders - file: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}" - state: absent \ No newline at end of file + file: "/tmp/{{ wazuh_agent_sources_installation.branch }}.tar.gz" + path: "/tmp/wazuh-{{ wazuh_agent_sources_installation.branch }}" + state: absent \ No newline at end of file diff --git a/roles/wazuh/ansible-wazuh-manager/tasks/installation_from_sources.yml b/roles/wazuh/ansible-wazuh-manager/tasks/installation_from_sources.yml index 411254b1..1bc17d9d 100644 --- a/roles/wazuh/ansible-wazuh-manager/tasks/installation_from_sources.yml +++ b/roles/wazuh/ansible-wazuh-manager/tasks/installation_from_sources.yml @@ -19,12 +19,14 @@ state: present - name: Removing old files - file: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz" - state: absent + file: + path: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz" + state: absent - name: Removing old folders - file: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}" - state: absent + file: + path: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}" + state: absent - name: Installing policycoreutils-python (RedHat families) package: @@ -98,12 +100,14 @@ chdir: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}" - name: Cleanup downloaded files - file: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz" - state: absent + file: + path: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz" + state: absent - name: Cleanup created folders - file: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}" - state: absent + file: + path: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}" + state: absent when: - not wazuh_ossec_control.stat.exists