Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wazuh install in unify-unattended script #1072

Merged
merged 17 commits into from
Dec 21, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion unattended_scripts/install_functions/opendistro/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

repogpg="https://packages.wazuh.com/key/GPG-KEY-WAZUH"
repobaseurl="https://packages.wazuh.com/4.x"
reporelease="stable"

if [ -n "${development}" ]; then
repogpg="https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH"
repobaseurl="https://packages-dev.wazuh.com/pre-release"
reporelease="unstable"
fi

getConfig() {
Expand Down Expand Up @@ -75,7 +77,7 @@ addWazuhrepo() {
eval "echo -e '[wazuh]\ngpgcheck=1\ngpgkey=${repogpg}\nenabled=1\nname=EL-\$releasever - Wazuh\nbaseurl='${repobaseurl}'/yum/\nprotect=1' | tee /etc/zypp/repos.d/wazuh.repo ${debug}"
elif [ ${sys_type} == "apt-get" ]; then
eval "curl -s ${repogpg} --max-time 300 | apt-key add - ${debug}"
eval "echo "deb '${repobaseurl}'/apt/ stable main" | tee /etc/apt/sources.list.d/wazuh.list ${debug}"
eval "echo "deb '${repobaseurl}'/apt/ '${reporelease}' main" | tee /etc/apt/sources.list.d/wazuh.list ${debug}"
eval "apt-get update -q ${debug}"
fi
else
Expand Down
4 changes: 2 additions & 2 deletions unattended_scripts/install_functions/opendistro/filebeat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ configureFilebeat() {
eval "chmod go+r /etc/filebeat/wazuh-template.json ${debug}"
eval "curl -s https://packages.wazuh.com/4.x/filebeat/wazuh-filebeat-0.1.tar.gz --max-time 300 | tar -xvz -C /usr/share/filebeat/module ${debug}"

nh=$(awk -v RS='' '/network.host:/' ./config.yml)
nh=$(awk -v RS='' '/network.host:/' ${base_path}/config.yml)

if [ -n "$nh" ]
then
Expand All @@ -45,7 +45,7 @@ configureFilebeat() {
echo " - ${nip}" >> /etc/filebeat/filebeat.yml
else
echo "output.elasticsearch.hosts:" >> /etc/filebeat/filebeat.yml
sh=$(awk -v RS='' '/discovery.seed_hosts:/' ./config.yml)
sh=$(awk -v RS='' '/discovery.seed_hosts:/' ${base_path}/config.yml)
rauldpm marked this conversation as resolved.
Show resolved Hide resolved
shr="discovery.seed_hosts:"
rm="- "
sh="${sh//$shr}"
Expand Down