fdcc9b7e0e
Change-Id: Ie5a08859010453d276b42253f5f2130f80b82224
18 lines
526 B
Smarty
18 lines
526 B
Smarty
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
{{ range $template, $fields := .Values.conf.templates }}
|
|
|
|
result=$(curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
|
|
-XPUT "${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_template/{{$template}}" \
|
|
-H 'Content-Type: application/json' -d @/tmp/{{$template}}.json \
|
|
| python -c "import sys, json; print(json.load(sys.stdin)['acknowledged'])")
|
|
if [ "$result" == "True" ]; then
|
|
echo "{{$template}} template created!"
|
|
else
|
|
echo "{{$template}} template not created!"
|
|
fi
|
|
|
|
{{ end }}
|