| This behavior is expected. In puppet 6, agents default to requesting a so called "rich data" catalog, which allows puppet to serialize data types that aren't natively supported in JSON, such as sensitive, binary, deferred, etc. Note the Accept: application/vnd.puppet.rich+json, ... header:
bx puppet agent -t --http_debug > /dev/null 2>&1 | grep -e 'puppet/v3/catalog' |
<- "POST /puppet/v3/catalog/localhost?environment=production HTTP/1.1\r\nX-Puppet-Version: 6.20.0\r\nUser-Agent: Puppet/6.20.0 Ruby/2.5.8-p224 (x86_64-darwin18)\r\nAccept: application/vnd.puppet.rich+json, application/json, application/vnd.puppet.rich+msgpack, application/x-msgpack, text/pson\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nHost: silly-devotion.delivery.puppetlabs.net:8140\r\nContent-Length: 24765\r\n\r\n"
|
Depending on what your application needs to do, you could instead ask for a "json" catalog, for example if you're doing a plain diff of the catalog.
bx puppet agent -t --http_debug --no-rich_data > /dev/null 2>&1 | grep -e 'puppet/v3/catalog' |
<- "POST /puppet/v3/catalog/localhost?environment=production HTTP/1.1\r\nX-Puppet-Version: 6.20.0\r\nUser-Agent: Puppet/6.20.0 Ruby/2.5.8-p224 (x86_64-darwin18)\r\nAccept: application/json, application/x-msgpack, text/pson\r\nContent-Type: application/x-www-form-urlencoded\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nHost: silly-devotion.delivery.puppetlabs.net:8140\r\nContent-Length: 24765\r\n\r\n"
|
If you need to preserve the puppet data types, then you will need to setup the loaders in the client application. Note in puppet 7 (and in later versions of puppet 6.x), it's not necessary to use the indirector to retrieve catalogs from the server. You might want to take a look at the new http client, something like:
require 'puppet' |
require 'pp' |
|
Puppet.initialize_settings |
# Puppet[:server] = "foo" |
# Puppet[:masterport] = 1234 |
# Puppet[:client_datadir] = "/somewhere" |
# Puppet[:http_debug] = true |
|