Install cmake when installing from sources

This commit is contained in:
VictorMorenoJimenez 2021-03-31 10:02:53 +02:00
parent 823fd336d3
commit ef79065de6
No known key found for this signature in database
GPG Key ID: CE9668E2E3083179
3 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,40 @@
---
# Vars
# cmake_download_url: http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz
# cmake_version: 3.18.3
#
- name: Include CMake install vars
include_vars: install_cmake.yml
- name: Download CMake sources
get_url:
url: "{{ cmake_download_url }}"
dest: "/tmp/cmake-{{ cmake_version }}.tar.gz"
register: cmake_download
- name: Unpack CMake
unarchive:
copy: no
dest: /tmp/
src: "{{ cmake_download.dest }}"
when: cmake_download.changed
register: cmake_unpack
- name: Configure CMake
command: "./bootstrap"
args:
chdir: "/tmp/cmake-{{ cmake_version }}"
when: cmake_unpack.changed
register: cmake_configure
- name: Install CMake
shell: make && make install
args:
chdir: "/tmp/cmake-{{ cmake_version }}"
when: cmake_configure.changed
- name: Delete installation files
file:
state: absent
path: "/tmp/cmake-{{ cmake_version }}"

View File

@ -18,6 +18,9 @@
- tar
state: present
- name: Install CMake
include_tasks: install_cmake.yml
- name: Removing old files
file:
path: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz"
@ -102,6 +105,8 @@
changed_when: installation_result == 0
args:
chdir: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}"
environment:
PATH: /usr/local/bin:{{ ansible_env.PATH }}
- name: Cleanup downloaded files
file:

View File

@ -0,0 +1,4 @@
# Install cmake vars
cmake_version: 3.18.3
cmake_download_url: "http://packages.wazuh.com/utils/cmake/cmake-{{ cmake_version }}.tar.gz"