Puppet Server: Admin API: Environment Cache
This version of Puppet Server is not included in Puppet Enterprise. The latest version of PE includes Puppet Server 2.4. A newer version is available; see the version menu above for details.
When using directory environments, the Puppet master caches the data it loads from disk for each environment. Puppet Server adds a new endpoint to the master’s HTTP API:
To trigger a complete invalidation of the data in this cache, make an HTTP request to this endpoint.
(Introduced in Puppet Server 1.1/2.1)
This endpoint accepts an optional query parameter,
environment, whose value
may be set to the name of a specific Puppet environment. If this parameter
is provided, only the specified environment will be flushed from the cache,
as opposed to all environments.
A successful request to this endpoint will return an
HTTP 204: No Content.
The response body will be empty.
$ curl -i --cert <PATH TO CERT> --key <PATH TO KEY> --cacert <PATH TO PUPPET CA CERT> -X DELETE https://localhost:8140/puppet-admin-api/v1/environment-cache HTTP/1.1 204 No Content $ curl -i --cert <PATH TO CERT> --key <PATH TO KEY> --cacert <PATH TO PUPPET CA CERT> -X DELETE https://localhost:8140/puppet-admin-api/v1/environment-cache?environment=production HTTP/1.1 204 No Content
Access to this endpoint is controlled by the
puppet-admin section of
the configuration page
for more information.
In the example above, the
curl command is using a certificate and private key. You must make sure this certificate’s name is included in the
puppet-admin -> client-whitelist setting before you can use it.