api fix?
This commit is contained in:
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@@ -110,11 +110,11 @@ pipeline {
|
||||
|
||||
// Query OPNSense DHCP leases API and parse with jq
|
||||
vmIp = sh(
|
||||
script: """
|
||||
curl -s -k -u "\${OPNSENSE_KEY}:\${OPNSENSE_SECRET}" \
|
||||
"https://${OPNSENSE_HOST}/api/dhcpv4/leases/searchLease" | \
|
||||
jq -r '.rows[] | select(.hostname == "${templateHost}" or .["client-hostname"] == "${templateHost}") | .address' | head -1
|
||||
""",
|
||||
script: '''
|
||||
curl -s -k -u "${OPNSENSE_KEY}:${OPNSENSE_SECRET}" \
|
||||
"https://''' + OPNSENSE_HOST + '''/api/dhcpv4/leases/searchLease" | \
|
||||
jq -r '.rows[] | select(.hostname == "''' + templateHost + '''" or .["client-hostname"] == "''' + templateHost + '''") | .address' | head -1
|
||||
''',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user