Been trying to write a script that will sign a cert for a new node, but I don't seem to be having any luck.
Here is the code I have so far
[System.net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$console_server = 'puppetserver'
$node = "new-test-server.local"
$action = '{"desired_state":"signed"}'
$json = $action | ConvertTo-Json
$url = "https://${console_server}:8140/puppet-ca/v1/certificate_status/${node}"
echo $url
$results = Invoke-RestMethod -Uri $url -body $json -method PUT -ContentType 'application/pson'
echo $results
I've spent most of the day trying to figure this one out. Any help would be appreciated./