Update conditionals to use new variables
This commit is contained in:
parent
df016d53c6
commit
46b4d34695
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
- include_tasks: "installation_from_sources"
|
- include_tasks: "installation_from_sources"
|
||||||
when:
|
when:
|
||||||
- wazuh_agent_config.repo.sources == "true"
|
- wazuh_sources_installation.enabled
|
||||||
|
|
||||||
- name: Debian/Ubuntu | Install apt-transport-https and ca-certificates
|
- name: Debian/Ubuntu | Install apt-transport-https and ca-certificates
|
||||||
apt:
|
apt:
|
||||||
@ -39,7 +39,7 @@
|
|||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
when:
|
when:
|
||||||
- wazuh_agent_config.repo.sources == "false"
|
- not wazuh_sources_installation.enabled
|
||||||
|
|
||||||
- name: Debian/Ubuntu | Set Distribution CIS filename for debian
|
- name: Debian/Ubuntu | Set Distribution CIS filename for debian
|
||||||
set_fact:
|
set_fact:
|
||||||
|
|||||||
@ -13,6 +13,7 @@
|
|||||||
poll: 30
|
poll: 30
|
||||||
when:
|
when:
|
||||||
- ansible_os_family|lower == "redhat"
|
- ansible_os_family|lower == "redhat"
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
tags:
|
tags:
|
||||||
- init
|
- init
|
||||||
|
|
||||||
@ -23,6 +24,7 @@
|
|||||||
cache_valid_time: 3600
|
cache_valid_time: 3600
|
||||||
when:
|
when:
|
||||||
- ansible_os_family|lower != "redhat"
|
- ansible_os_family|lower != "redhat"
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
tags:
|
tags:
|
||||||
- init
|
- init
|
||||||
|
|
||||||
@ -192,7 +194,11 @@
|
|||||||
tags: config
|
tags: config
|
||||||
|
|
||||||
- include_tasks: "RMRedHat.yml"
|
- include_tasks: "RMRedHat.yml"
|
||||||
when: ansible_os_family == "RedHat"
|
when:
|
||||||
|
- ansible_os_family == "RedHat"
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
|
|
||||||
- include_tasks: "RMDebian.yml"
|
- include_tasks: "RMDebian.yml"
|
||||||
when: ansible_os_family == "Debian"
|
when:
|
||||||
|
- ansible_os_family == "Debian"
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
- include_tasks: "installation_from_sources"
|
- include_tasks: "installation_from_sources"
|
||||||
when:
|
when:
|
||||||
- wazuh_agent_config.repo.sources == "true"
|
- wazuh_sources_installation.enabled
|
||||||
|
|
||||||
- name: RedHat/CentOS 5 | Install Wazuh repo
|
- name: RedHat/CentOS 5 | Install Wazuh repo
|
||||||
yum_repository:
|
yum_repository:
|
||||||
@ -15,7 +15,7 @@
|
|||||||
when:
|
when:
|
||||||
- (ansible_facts['os_family']|lower == 'redhat') and (ansible_distribution|lower != 'amazon')
|
- (ansible_facts['os_family']|lower == 'redhat') and (ansible_distribution|lower != 'amazon')
|
||||||
- (ansible_distribution_major_version|int <= 5)
|
- (ansible_distribution_major_version|int <= 5)
|
||||||
- wazuh_agent_config.repo.sources == "false"
|
- not wazuh_sources_installation.enabled
|
||||||
register: repo_v5_installed
|
register: repo_v5_installed
|
||||||
|
|
||||||
- name: RedHat/CentOS/Fedora | Install Wazuh repo
|
- name: RedHat/CentOS/Fedora | Install Wazuh repo
|
||||||
@ -28,7 +28,7 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
- repo_v5_installed is skipped
|
- repo_v5_installed is skipped
|
||||||
- wazuh_agent_config.repo.sources == "false"
|
- not wazuh_sources_installation.enabled
|
||||||
|
|
||||||
- name: RedHat/CentOS/Fedora | download Oracle Java RPM
|
- name: RedHat/CentOS/Fedora | download Oracle Java RPM
|
||||||
get_url:
|
get_url:
|
||||||
|
|||||||
@ -23,12 +23,14 @@
|
|||||||
when:
|
when:
|
||||||
- ansible_distribution == "Ubuntu"
|
- ansible_distribution == "Ubuntu"
|
||||||
- ansible_distribution_major_version | int == 14
|
- ansible_distribution_major_version | int == 14
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
|
|
||||||
- name: Debian/Ubuntu | Installing Wazuh repository key
|
- name: Debian/Ubuntu | Installing Wazuh repository key
|
||||||
apt_key:
|
apt_key:
|
||||||
url: "{{ wazuh_manager_config.repo.gpg }}"
|
url: "{{ wazuh_manager_config.repo.gpg }}"
|
||||||
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_sources_installation.enabled
|
||||||
|
|
||||||
- name: Debian/Ubuntu | Add Wazuh repositories
|
- name: Debian/Ubuntu | Add Wazuh repositories
|
||||||
apt_repository:
|
apt_repository:
|
||||||
@ -37,6 +39,8 @@
|
|||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
when:
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
|
|
||||||
- name: Debian/Ubuntu | Installing NodeJS repository key (Ubuntu 14)
|
- name: Debian/Ubuntu | Installing NodeJS repository key (Ubuntu 14)
|
||||||
become: true
|
become: true
|
||||||
@ -126,3 +130,5 @@
|
|||||||
register: wazuh_manager_main_packages_installed
|
register: wazuh_manager_main_packages_installed
|
||||||
until: wazuh_manager_main_packages_installed is succeeded
|
until: wazuh_manager_main_packages_installed is succeeded
|
||||||
tags: init
|
tags: init
|
||||||
|
when:
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
|
|||||||
@ -41,6 +41,7 @@
|
|||||||
when:
|
when:
|
||||||
- (ansible_os_family|lower == 'redhat') and (ansible_distribution|lower != 'amazon')
|
- (ansible_os_family|lower == 'redhat') and (ansible_distribution|lower != 'amazon')
|
||||||
- (ansible_distribution_major_version|int <= 5)
|
- (ansible_distribution_major_version|int <= 5)
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
register: repo_v5_manager_installed
|
register: repo_v5_manager_installed
|
||||||
|
|
||||||
- name: RedHat/CentOS/Fedora | Install Wazuh repo
|
- name: RedHat/CentOS/Fedora | Install Wazuh repo
|
||||||
@ -53,6 +54,7 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
- repo_v5_manager_installed is skipped
|
- repo_v5_manager_installed is skipped
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
|
|
||||||
- name: RedHat/CentOS/Fedora | Install openscap
|
- name: RedHat/CentOS/Fedora | Install openscap
|
||||||
package: name={{ item }} state=present
|
package: name={{ item }} state=present
|
||||||
@ -149,6 +151,7 @@
|
|||||||
until: wazuh_manager_main_packages_installed is succeeded
|
until: wazuh_manager_main_packages_installed is succeeded
|
||||||
when:
|
when:
|
||||||
- ansible_os_family|lower == "redhat"
|
- ansible_os_family|lower == "redhat"
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
tags:
|
tags:
|
||||||
- init
|
- init
|
||||||
|
|
||||||
|
|||||||
@ -354,7 +354,11 @@
|
|||||||
- ansible_distribution in ['CentOS', 'RedHat', 'Amazon'] and ansible_distribution_major_version|int < 6
|
- ansible_distribution in ['CentOS', 'RedHat', 'Amazon'] and ansible_distribution_major_version|int < 6
|
||||||
|
|
||||||
- include_tasks: "RMRedHat.yml"
|
- include_tasks: "RMRedHat.yml"
|
||||||
when: ansible_os_family == "RedHat" or ansible_os_family == "Amazon"
|
when:
|
||||||
|
- ansible_os_family == "RedHat" or ansible_os_family == "Amazon"
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
|
|
||||||
- include_tasks: "RMDebian.yml"
|
- include_tasks: "RMDebian.yml"
|
||||||
when: ansible_os_family == "Debian"
|
when:
|
||||||
|
- ansible_os_family == "Debian"
|
||||||
|
- not wazuh_sources_installation.enabled
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user