Update installation_from_sources.yml. Added installation conditionals
This commit is contained in:
parent
46b4d34695
commit
8ecbeff501
@ -7,53 +7,59 @@
|
|||||||
name:
|
name:
|
||||||
- make
|
- make
|
||||||
- gcc
|
- gcc
|
||||||
- policycoreutils-python-utils
|
|
||||||
- automake
|
- automake
|
||||||
- autoconf
|
- autoconf
|
||||||
- libtool
|
- libtool
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- name: Installing policycoreutils-python (RedHat families)
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- policycoreutils-python
|
||||||
|
when:
|
||||||
|
- ansible_os_family|lower == "redhat"
|
||||||
|
|
||||||
|
- name: Installing policycoreutils-python-utils (Debian families)
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- libc6-dev
|
||||||
|
- curl
|
||||||
|
- policycoreutils
|
||||||
|
when:
|
||||||
|
- ansible_os_family|lower == "debian"
|
||||||
|
|
||||||
- name: Download required packages from github.com/wazuh/wazuh
|
- name: Download required packages from github.com/wazuh/wazuh
|
||||||
get_url:
|
get_url:
|
||||||
url: "https://github.com/wazuh/wazuh/archive/{{ wazuh_agent_config.repo.sources_branch }}.tar.gz"
|
url: "https://github.com/wazuh/wazuh/archive/{{ wazuh_sources_installation.branch }}.tar.gz"
|
||||||
dest: "/tmp/{{ wazuh_agent_config.repo.sources_branch }}.tar.gz"
|
dest: "/tmp/{{ wazuh_sources_installation.branch }}.tar.gz"
|
||||||
delegate_to: "{{ inventory_hostname }}"
|
delegate_to: "{{ inventory_hostname }}"
|
||||||
|
|
||||||
- name: Extract downloaded Wazuh branch from Github
|
- name: Extract downloaded Wazuh branch from Github
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "/tmp/{{ wazuh_agent_config.repo.sources_branch }}.tar.gz"
|
src: "/tmp/{{ wazuh_sources_installation.branch }}.tar.gz"
|
||||||
dest: "/tmp/"
|
dest: "/tmp/"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
|
|
||||||
- name: Configure "preloaded_vars.conf" file
|
|
||||||
copy:
|
|
||||||
dest: "/tmp/wazuh-{{ wazuh_agent_config.repo.sources_branch }}/etc/preloaded-vars.conf"
|
|
||||||
content: |
|
|
||||||
USER_LANGUAGE="en"
|
|
||||||
USER_NO_STOP="y"
|
|
||||||
USER_INSTALL_TYPE="agent"
|
|
||||||
USER_DIR="/var/ossec"
|
|
||||||
USER_ENABLE_SYSCHECK="y"
|
|
||||||
USER_ENABLE_ROOTCHECK="y"
|
|
||||||
USER_ENABLE_OPENSCAP="y"
|
|
||||||
USER_ENABLE_ACTIVE_RESPONSE="y"
|
|
||||||
USER_AGENT_SERVER_IP="{{ wazuh_managers.0.address }}"
|
|
||||||
USER_CA_STORE="/var/ossec/wpk_root.pem"
|
|
||||||
USER_ENABLE_SCA="y"
|
|
||||||
force: 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 }}"
|
||||||
args:
|
args:
|
||||||
chdir: "/tmp/wazuh-{{ wazuh_agent_config.repo.sources_branch }}/src/"
|
chdir: "/tmp/wazuh-{{ wazuh_sources_installation.branch }}/src/"
|
||||||
with_items:
|
with_items:
|
||||||
- "clean"
|
- "clean"
|
||||||
- "clean-deps"
|
- "clean-deps"
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
|
- name: Render the "preloaded-vars.conf" file
|
||||||
|
template:
|
||||||
|
src: ../templates/preloaded_vars.conf.j2
|
||||||
|
dest: "/tmp/wazuh-{{ wazuh_sources_installation.branch }}/etc/preloaded-vars.conf"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '644'
|
||||||
|
|
||||||
- name: Executing "install.sh" script to build and install the Wazuh Agent
|
- name: Executing "install.sh" script to build and install the Wazuh Agent
|
||||||
shell: ./install.sh
|
shell: ./install.sh
|
||||||
args:
|
args:
|
||||||
chdir: "/tmp/wazuh-{{ wazuh_agent_config.repo.sources_branch }}"
|
chdir: "/tmp/wazuh-{{ wazuh_sources_installation.branch }}"
|
||||||
|
|
||||||
become: yes
|
become: yes
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user