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