Skip to content

Commit

Permalink
Merge pull request #1250 from wazuh/unify-unattended-fixes
Browse files Browse the repository at this point in the history
Unify unattended fixes for the healtch check and apt installations
  • Loading branch information
alberpilot authored Feb 10, 2022
2 parents a957be6 + 974874d commit 00bad33
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion unattended_installer/install_functions/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion unattended_installer/install_functions/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions unattended_installer/install_functions/dashboards.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions unattended_installer/install_functions/filebeat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion unattended_installer/install_functions/indexer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion unattended_installer/install_functions/manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 00bad33

Please sign in to comment.