File: oci-puppet-external-node-classifier

package info (click to toggle)
openstack-cluster-installer 43.0.18
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,484 kB
  • sloc: php: 19,127; sh: 18,142; ruby: 75; makefile: 31; xml: 8
file content (24 lines) | stat: -rwxr-xr-x 421 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -e

TMPFILE=$(mktemp -t puppet-oci-enc.XXXXXX)

HOSTNAME=${1}

# Fetch ENC from web server
curl -s "http://localhost/oci/api.php?action=enc&hostname=${HOSTNAME}" >${TMPFILE}

# Check the status
SUCCESS=$(cat ${TMPFILE} | jq --raw-output '.["status"]')
if ! [ "${SUCCESS}" = "success" ] ; then
	exit 1
fi

# Output result
cat ${TMPFILE} | jq --raw-output '.["data"]'

rm ${TMPFILE}

# Great success!
exit 0