Update tasks that download the Wazuh branch and extract it.

This commit is contained in:
Jose M 2019-11-20 14:59:38 +01:00
parent 219b35c2ef
commit 35d35b5059

View File

@ -1,7 +1,4 @@
---
- hosts: all
tasks:
- include_vars: ../defaults/main.yml
- name: Install dependencies to build Wazuh packages
package:
name:
@ -10,6 +7,7 @@
- automake
- autoconf
- libtool
- tar
state: present
- name: Installing policycoreutils-python (RedHat families)
@ -34,11 +32,15 @@
dest: "/tmp/{{ wazuh_sources_installation.branch }}.tar.gz"
delegate_to: "{{ inventory_hostname }}"
- name: Create folder to extract Wazuh branch
file:
path: "/tmp/wazuh-{{ wazuh_sources_installation.branch }}"
state: directory
- name: Extract downloaded Wazuh branch from Github
unarchive:
src: "/tmp/{{ wazuh_sources_installation.branch }}.tar.gz"
dest: "/tmp/"
remote_src: yes
shell: "tar -xzvf /tmp/{{ wazuh_sources_installation.branch }}.tar.gz --strip 1 --directory /tmp/wazuh-{{ wazuh_sources_installation.branch }}"
args:
warn: false
- name: Clean remaining files from others builds
command: "make -C src {{ item }}"
@ -53,7 +55,7 @@
- name: Render the "preloaded-vars.conf" file
template:
src: /templates/preloaded_vars.conf.j2
src: "templates/preloaded_vars.conf.j2"
dest: "/tmp/wazuh-{{ wazuh_sources_installation.branch }}/etc/preloaded-vars.conf"
owner: root
group: root
@ -65,4 +67,3 @@
changed_when: installation_result == 0
args:
chdir: "/tmp/wazuh-{{ wazuh_sources_installation.branch }}"
become: yes