From 10ef289eba0b17c478bae357b1e9084c10e8e689 Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 10 Feb 2022 13:02:42 +0100 Subject: [PATCH 1/3] Added DEBIAN_FRONTEND=noninteractive to all apt installations in the script --- unattended_installer/install_functions/common.sh | 2 +- unattended_installer/install_functions/dashboards.sh | 6 ++++-- unattended_installer/install_functions/filebeat.sh | 6 ++++-- unattended_installer/install_functions/manager.sh | 4 +++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/unattended_installer/install_functions/common.sh b/unattended_installer/install_functions/common.sh index e5ed7a030b..2166eaecb0 100644 --- a/unattended_installer/install_functions/common.sh +++ b/unattended_installer/install_functions/common.sh @@ -164,7 +164,7 @@ function common_installPrerequisites() { eval "zypper -n install libcap-progs tar gnupg ${openssl} ${debug} || zypper -n install libcap2 tar gnupg ${openssl} ${debug}" elif [ "${sys_type}" == "apt-get" ]; then eval "apt-get update -q ${debug}" - eval "apt-get install apt-transport-https curl unzip wget libcap2-bin tar software-properties-common gnupg ${openssl} -y ${debug}" + eval "DEBIAN_FRONTEND=noninteractive apt install apt-transport-https curl unzip wget libcap2-bin tar software-properties-common gnupg ${openssl} -y ${debug}" fi if [ "$?" != 0 ]; then diff --git a/unattended_installer/install_functions/dashboards.sh b/unattended_installer/install_functions/dashboards.sh index 85ba316aa8..263f9d6c4b 100644 --- a/unattended_installer/install_functions/dashboards.sh +++ b/unattended_installer/install_functions/dashboards.sh @@ -150,8 +150,10 @@ function dashboards_install() { logger "Starting Wazuh dashboards installation." if [ "${sys_type}" == "zypper" ]; then eval "zypper -n install wazuh-dashboards=${wazuh_version}-${wazuh_revision} ${debug}" - else - eval "${sys_type} install wazuh-dashboards${sep}${wazuh_version}-${wazuh_revision} -y ${debug}" + elif [ "${sys_type}" == "yum" ]; then + eval "yum install wazuh-dashboards${sep}${wazuh_version}-${wazuh_revision} -y ${debug}" + elif [ "${sys_type}" == "apt-get" ]; then + eval "DEBIAN_FRONTEND=noninteractive apt install wazuh-dashboards${sep}${wazuh_version}-${wazuh_revision} -y ${debug}" fi if [ "$?" != 0 ]; then logger -e "Wazuh dashboards installation failed" diff --git a/unattended_installer/install_functions/filebeat.sh b/unattended_installer/install_functions/filebeat.sh index d67fafa070..feedcfb6dd 100644 --- a/unattended_installer/install_functions/filebeat.sh +++ b/unattended_installer/install_functions/filebeat.sh @@ -57,8 +57,10 @@ function filebeat_install() { logger "Starting filebeat installation." if [ "${sys_type}" == "zypper" ]; then eval "zypper -n install filebeat-${filebeat_version} ${debug}" - else - eval "${sys_type} install filebeat${sep}${filebeat_version} -y -q ${debug}" + elif [ "${sys_type}" == "yum" ]; then + eval "yum install filebeat${sep}${filebeat_version} -y -q ${debug}" + elif [ "${sys_type}" == "apt-get" ]; then + eval "DEBIAN_FRONTEND=noninteractive apt install filebeat${sep}${filebeat_version} -y -q ${debug}" fi if [ "$?" != 0 ]; then logger -e "Filebeat installation failed" diff --git a/unattended_installer/install_functions/manager.sh b/unattended_installer/install_functions/manager.sh index 078c5cc81a..a8edb71484 100644 --- a/unattended_installer/install_functions/manager.sh +++ b/unattended_installer/install_functions/manager.sh @@ -46,8 +46,10 @@ function manager_install() { logger "Starting the Wazuh manager installation." if [ "${sys_type}" == "zypper" ]; then eval "${sys_type} -n install wazuh-manager=${wazuh_version}-${wazuh_revision} ${debug}" - else + elif [ "${sys_type}" == "yum" ]; then eval "${sys_type} install wazuh-manager${sep}${wazuh_version}-${wazuh_revision} -y ${debug}" + elif [ "${sys_type}" == "apt-get" ]; then + eval "DEBIAN_FRONTEND=noninteractive ${sys_type} install wazuh-manager${sep}${wazuh_version}-${wazuh_revision} -y ${debug}" fi if [ "$?" != 0 ]; then logger -e "Wazuh installation failed" From 5c7f0a089423e699d85c5105ac3dd279f7ddd224 Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 10 Feb 2022 13:29:24 +0100 Subject: [PATCH 2/3] Add DEBIAN_FRONTEND=noninteractive to indexer installation --- unattended_installer/install_functions/indexer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unattended_installer/install_functions/indexer.sh b/unattended_installer/install_functions/indexer.sh index e17a8450a0..f2059dce87 100644 --- a/unattended_installer/install_functions/indexer.sh +++ b/unattended_installer/install_functions/indexer.sh @@ -129,7 +129,7 @@ function indexer_install() { elif [ "${sys_type}" == "zypper" ]; then eval "zypper -n install wazuh-indexer=${wazuh_version}-${wazuh_revision} ${debug}" elif [ "${sys_type}" == "apt-get" ]; then - eval "apt install wazuh-indexer=${wazuh_version}-${wazuh_revision} -y ${debug}" + eval "DEBIAN_FRONTEND=noninteractive apt install wazuh-indexer=${wazuh_version}-${wazuh_revision} -y ${debug}" fi if [ "$?" != 0 ]; then From 974874d8bb5c87244d20a2a5e0f3afecfc5356d8 Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 10 Feb 2022 13:47:17 +0100 Subject: [PATCH 3/3] Fix ram and core checks for aio --- unattended_installer/install_functions/checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unattended_installer/install_functions/checks.sh b/unattended_installer/install_functions/checks.sh index 80b800664c..494087abe6 100644 --- a/unattended_installer/install_functions/checks.sh +++ b/unattended_installer/install_functions/checks.sh @@ -177,7 +177,7 @@ function checks_health() { fi fi - if [ -n "${aio}" ]; then + if [ -n "${AIO}" ]; then if [ "${cores}" -lt 2 ] || [ "${ram_gb}" -lt 3700 ]; then logger -e "Your system does not meet the recommended minimum hardware requirements of 4Gb of RAM and 2 CPU cores. If you want to proceed with the installation use the -i option to ignore these requirements." exit 1