Install cmake when installing from sources
This commit is contained in:
parent
823fd336d3
commit
ef79065de6
40
roles/wazuh/ansible-wazuh-manager/tasks/install_cmake.yml
Normal file
40
roles/wazuh/ansible-wazuh-manager/tasks/install_cmake.yml
Normal 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 }}"
|
||||||
@ -18,6 +18,9 @@
|
|||||||
- tar
|
- tar
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Install CMake
|
||||||
|
include_tasks: install_cmake.yml
|
||||||
|
|
||||||
- name: Removing old files
|
- name: Removing old files
|
||||||
file:
|
file:
|
||||||
path: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz"
|
path: "/tmp/{{ wazuh_manager_sources_installation.branch }}.tar.gz"
|
||||||
@ -102,6 +105,8 @@
|
|||||||
changed_when: installation_result == 0
|
changed_when: installation_result == 0
|
||||||
args:
|
args:
|
||||||
chdir: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}"
|
chdir: "/tmp/wazuh-{{ wazuh_manager_sources_installation.branch }}"
|
||||||
|
environment:
|
||||||
|
PATH: /usr/local/bin:{{ ansible_env.PATH }}
|
||||||
|
|
||||||
- name: Cleanup downloaded files
|
- name: Cleanup downloaded files
|
||||||
file:
|
file:
|
||||||
|
|||||||
4
roles/wazuh/ansible-wazuh-manager/vars/install_cmake.yml
Normal file
4
roles/wazuh/ansible-wazuh-manager/vars/install_cmake.yml
Normal 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"
|
||||||
Loading…
Reference in New Issue
Block a user