mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-29 12:23:38 +01:00
Replace salt's http.wait_for_successful_query with so-common's wait_for_web_response due to issues with salt
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
# {%- set FLEET_NODE = salt['pillar.get']('global:fleet_node', False) -%}
|
||||
# {%- set MANAGER = salt['pillar.get']('global:url_base', '') %}
|
||||
|
||||
. /usr/sbin/so-common
|
||||
|
||||
# Copy template file
|
||||
cp /opt/so/conf/kibana/saved_objects.ndjson.template /opt/so/conf/kibana/saved_objects.ndjson
|
||||
|
||||
@@ -14,9 +16,11 @@ cp /opt/so/conf/kibana/saved_objects.ndjson.template /opt/so/conf/kibana/saved_o
|
||||
# SOCtopus and Manager
|
||||
sed -i "s/PLACEHOLDER/{{ MANAGER }}/g" /opt/so/conf/kibana/saved_objects.ndjson
|
||||
|
||||
wait_for_web_response "http://localhost:5601/app/kibana" "Elastic"
|
||||
## This hackery will be removed if using Elastic Auth ##
|
||||
|
||||
# Let's snag a cookie from Kibana
|
||||
THECOOKIE=$(curl -c - -X GET http://localhost:5601/ | grep sid | awk '{print $7}')
|
||||
|
||||
# Load saved objects
|
||||
curl -b "sid=$THECOOKIE" -L -X POST "localhost:5601/api/saved_objects/_import?overwrite=true" -H "kbn-xsrf: true" --form file=@/opt/so/conf/kibana/saved_objects.ndjson > /dev/null 2>&1
|
||||
|
||||
@@ -94,21 +94,10 @@ kibanadashtemplate:
|
||||
- user: 932
|
||||
- group: 939
|
||||
|
||||
wait_for_kibana:
|
||||
module.run:
|
||||
- http.wait_for_successful_query:
|
||||
- url: "http://{{MANAGER}}:5601/api/saved_objects/_find?type=config"
|
||||
- wait_for: 900
|
||||
- onchanges:
|
||||
- file: kibanadashtemplate
|
||||
|
||||
so-kibana-config-load:
|
||||
cmd.run:
|
||||
- name: /usr/sbin/so-kibana-config-load
|
||||
- cwd: /opt/so
|
||||
- onchanges:
|
||||
- wait_for_kibana
|
||||
|
||||
|
||||
# Keep the setting correct
|
||||
#KibanaHappy:
|
||||
|
||||
Reference in New Issue
Block a user