Wazuh - Move agent config to init.sls

This commit is contained in:
Wes Lambert
2018-12-12 06:05:13 +00:00
parent 823a589fae
commit 8404897fe3
2 changed files with 11 additions and 7 deletions
+3 -2
View File
@@ -1,3 +1,4 @@
{%- set ip = salt['pillar.get']('static:masterip', '') %}
#!/bin/bash
###
@@ -23,7 +24,7 @@ PROTOCOL="https"
USER="foo"
PASSWORD="bar"
AGENT_NAME=$(hostname)
AGENT_IP=""
AGENT_IP="{{ip}}"
display_help() {
cat <<HELP_USAGE
@@ -49,7 +50,7 @@ register_agent() {
if [ "$?" != "0" ]; then
echo -e $API_RESULT | sed -rn 's/.*"message":"(.+)".*/\1/p'
exit 1
exit 0
fi
# Get agent id and agent key
AGENT_ID=$(echo $API_RESULT | cut -d':' -f 4 | cut -d ',' -f 1)