summaryrefslogtreecommitdiff
path: root/sitemodules/profiles/templates
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2019-07-20 20:46:48 +0200
committerJan Dittberner <jandd@cacert.org>2019-07-20 20:46:48 +0200
commit0b243f6ed18188c2e43ecc48adde0e14b4e6e3f1 (patch)
tree8d9edd8e99c09a97b4953182095deb7025ea3780 /sitemodules/profiles/templates
parent573b6e8c5af6439bef4c793c6268cf109d931541 (diff)
downloadcacert-puppet-0b243f6ed18188c2e43ecc48adde0e14b4e6e3f1.tar.gz
cacert-puppet-0b243f6ed18188c2e43ecc48adde0e14b4e6e3f1.tar.xz
cacert-puppet-0b243f6ed18188c2e43ecc48adde0e14b4e6e3f1.zip
Fix syntax issues in agent setup script
Diffstat (limited to 'sitemodules/profiles/templates')
-rw-r--r--sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp5
1 files changed, 2 insertions, 3 deletions
diff --git a/sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp b/sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp
index c12eb62..c4aef81 100644
--- a/sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp
+++ b/sitemodules/profiles/templates/icinga2_agent/setup_agent.sh.epp
@@ -7,15 +7,14 @@
set -e
-TICKET=$(/usr/bin/curl -s --cacert /etc/icinga2/pki/ca.crt \
+TICKET=$(/usr/bin/curl -f -s --cacert /etc/icinga2/pki/ca.crt \
-u "<%= $pki_api_user %>:<%= $pki_api_password %>" \
-H "Accept: application/json" \
--resolve "<%= $master_host %>:5665:<%= $master_ip %>" \
"https://<%= $master_host %>:5665/v1/actions/generate-ticket" \
--data '{ "cn": "<%= $::facts["fqdn"] %>" }' | \
/usr/bin/python3 -c \
- 'import json, sys;
- print(json.load(sys.stdin)["results"][0]["ticket"])')
+ 'import json, sys; print(json.load(sys.stdin)["results"][0]["ticket"])')
/usr/sbin/icinga2 node setup --ticket "${TICKET}" \
--cn "<%= $::facts["fqdn"] %>" \