Skip to content

Commit

Permalink
add: Add health_check parameter to wazuh_deployment stage. #1723
Browse files Browse the repository at this point in the history
If True health-check will be performed, False otherwise. Default value: True.

Also wazuh_installation useless cfg key removed.
  • Loading branch information
Luis Gonzalez committed Aug 20, 2021
1 parent bc41293 commit 80c27c7
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from time import sleep
import logging
from wazuh_testing.qa_ctl.provisioning.ansible.AnsibleInstance import AnsibleInstance
from wazuh_testing.qa_ctl.provisioning.ansible.AnsibleInventory import AnsibleInventory
from wazuh_testing.qa_ctl.provisioning.wazuh_deployment.LocalPackage import LocalPackage
Expand Down Expand Up @@ -77,8 +78,9 @@ def process_deployment_data(self):
for _, host_value in self.provision_info['hosts'].items():
current_host = host_value['host_info']['host']
if 'wazuh_deployment' in host_value:
deploy_info = host_value['wazuh_deployment']['wazuh_installation']

deploy_info = host_value['wazuh_deployment']
health_check = True if 'health_check' not in host_value['wazuh_deployment'] \
else host_value['wazuh_deployment']['health_check']
install_target = None if 'target' not in deploy_info else deploy_info['target']
install_type = None if 'type' not in deploy_info else deploy_info['type']
installation_files_path = None if 'installation_files_path' not in deploy_info \
Expand Down Expand Up @@ -118,9 +120,14 @@ def process_deployment_data(self):
install_mode=install_type, hosts=current_host)

deployment_instance.install()
# Wait for Wazuh initialization before health_check
sleep(60)
deployment_instance.health_check()

if health_check:
logging.info('Waiting for Wazuh installation')
sleep(60)
logging.info('Performing health check')
deployment_instance.health_check()
else:
logging.warning('Health check not performed')

self.wazuh_installation_paths[deployment_instance.hosts] = deployment_instance.install_dir_path

Expand Down

0 comments on commit 80c27c7

Please sign in to comment.