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

View File

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

View File

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

View File

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