Merge branch 'devel' into feature-376-support-centos8

This commit is contained in:
Jose M. Garcia 2020-03-03 11:53:46 +01:00 committed by GitHub
commit 1fb14f66d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 12 deletions

View File

@ -24,7 +24,7 @@
- ansible_distribution == "Ubuntu"
- ansible_distribution_major_version | int == 14
- not wazuh_manager_sources_installation.enabled or not wazuh_api_sources_installation.enabled
- not wazuh_custom_packages_installation_manager_enabled or not wazuh_custom_packages_installation_manager_enabled
- not wazuh_custom_packages_installation_manager_enabled or not wazuh_custom_packages_installation_api_enabled
- name: Debian/Ubuntu | Installing Wazuh repository key
apt_key:
@ -33,7 +33,7 @@
when:
- not (ansible_distribution == "Ubuntu" and ansible_distribution_major_version | int == 14)
- not wazuh_manager_sources_installation.enabled or not wazuh_api_sources_installation.enabled
- not wazuh_custom_packages_installation_manager_enabled or not wazuh_custom_packages_installation_manager_enabled
- not wazuh_custom_packages_installation_manager_enabled or not wazuh_custom_packages_installation_api_enabled
- name: Debian/Ubuntu | Add Wazuh repositories
apt_repository:
@ -44,7 +44,7 @@
changed_when: false
when:
- not wazuh_manager_sources_installation.enabled or not wazuh_api_sources_installation.enabled
- not wazuh_custom_packages_installation_manager_enabled or not wazuh_custom_packages_installation_manager_enabled
- not wazuh_custom_packages_installation_manager_enabled or not wazuh_custom_packages_installation_api_enabled
- name: Debian/Ubuntu | Set Distribution CIS filename for Debian/Ubuntu
set_fact:
@ -117,7 +117,7 @@
- include_tasks: "installation_from_custom_packages.yml"
when:
- wazuh_custom_packages_installation_manager_enabled or not wazuh_custom_packages_installation_manager_enabled
- wazuh_custom_packages_installation_manager_enabled or wazuh_custom_packages_installation_api_enabled
- name: Debian/Ubuntu | Install wazuh-api
apt:
@ -131,4 +131,5 @@
tags: init
when:
- not wazuh_api_sources_installation.enabled
- not wazuh_custom_packages_installation_manager_enabled
- not wazuh_custom_packages_installation_manager_enabled
- wazuh_manager_config.cluster.node_type == "master"

View File

@ -142,6 +142,7 @@
- ansible_os_family|lower == "redhat"
- not wazuh_api_sources_installation.enabled
- not wazuh_custom_packages_installation_api_enabled
- wazuh_manager_config.cluster.node_type == "master"
tags:
- init

View File

@ -13,6 +13,8 @@
state: present
when:
- wazuh_custom_packages_installation_api_enabled
- wazuh_manager_config.cluster.node_type == "master"
when:
- ansible_os_family|lower == "debian"
@ -47,6 +49,7 @@
- not (ansible_distribution|lower == "centos" and ansible_distribution_major_version >= "8")
- not (ansible_distribution|lower == "redhat" and ansible_distribution_major_version >= "8")
- not (ansible_distribution|lower == "amazon" and ansible_distribution_major_version >= "2")
- wazuh_manager_config.cluster.node_type == "master"
- name: Install Wazuh API from .rpm packages | dnf
dnf:
@ -57,6 +60,7 @@
- (ansible_distribution|lower == "centos" and ansible_distribution_major_version >= "8") or
(ansible_distribution|lower == "redhat" and ansible_distribution_major_version >= "8") or
(ansible_distribution|lower == "amazon" and ansible_distribution_major_version >= "2")
- wazuh_manager_config.cluster.node_type == "master"
when:
- ansible_os_family|lower == "redhat"

View File

@ -122,6 +122,8 @@
stat:
path: /var/ossec/api/app.js
register: wazuh_api
when:
- wazuh_manager_config.cluster.node_type == "master"
- name: Install Wazuh API from sources
block:
@ -178,5 +180,6 @@
when:
- not wazuh_api.stat.exists
- wazuh_api_sources_installation.enabled
- wazuh_manager_config.cluster.node_type == "master"
tags:
- api

View File

@ -11,6 +11,8 @@
stat:
path: /usr/bin/node
register: node_service_status
when:
- wazuh_manager_config.cluster.node_type == "master"
- name: Install NodeJS repository
block:
@ -25,7 +27,9 @@
command: sh /etc/nodejs.sh
register: nodejs_script
changed_when: nodejs_script.rc == 0
when: not node_service_status.stat.exists
when:
- not node_service_status.stat.exists
- wazuh_manager_config.cluster.node_type == "master"
- name: Installing NodeJS
package:
@ -33,6 +37,9 @@
state: present
register: nodejs_service_is_installed
until: nodejs_service_is_installed is succeeded
when:
- wazuh_manager_config.cluster.node_type == "master"
tags: init
- include_tasks: "RedHat.yml"
@ -168,6 +175,9 @@
group=ossec
mode=0740
notify: restart wazuh-api
when:
- wazuh_manager_config.cluster.node_type == "master"
tags:
- init
- config
@ -304,6 +314,7 @@
notify: restart wazuh-api
when:
- wazuh_api_user is defined
- wazuh_manager_config.cluster.node_type == "master"
tags:
- config
@ -325,14 +336,20 @@
tags:
- config
- name: Ensure Wazuh Manager, wazuh API service is started and enabled
- name: Ensure Wazuh Manager service is started and enabled.
service:
name: "{{ item }}"
name: "wazuh-manager"
enabled: true
state: started
with_items:
- wazuh-manager
- wazuh-api
tags:
- config
- name: Ensure Wazuh API service is started and enabled.
service:
name: "wazuh-api"
enabled: true
state: started
when: wazuh_manager_config.cluster.node_type == "master"
tags:
- config