Msgpack support

Puppet agents and primary servers communicate over HTTPS, exchanging structured data in JSON.

Msgpack is an efficient serialization protocol that behaves similarly to JSON. It provides faster and more robust serialization for agent-server communications, without requiring many changes in our code.

Important: When msgpack is enabled, the primary Puppet server and agent communicates using msgpack instead of JSON.

Enabling Msgpack serialization

Enabling msgpack is easy, but first, it must be installed because the gem is not included in the puppet-agent or puppetserver packages.

  1. Install the msgpack gem on your primary server and all agent nodes.

    If you are using the Puppet Enterprise test environment, make sure to use PE gem command instead of the system gem command.

    On *nix nodes, run the following command:
    /opt/puppetlabs/puppet/bin/gem install msgpack
    On Windows nodes, run the following command:
    "C:\Program Files\Puppet Labs\Puppet\sys\ruby\bin\gem" install msgpack
    On Puppet Server, run the following command and then restart the Puppet Server service:
    puppetserver gem install msgpack
  2. In the [agent] or [main] section of puppet.conf on any number of agent nodes, set the preferred_serialization_format setting to msgpack. Read about the preferred_serialization_forat setting in the Configuration Reference.
Results

After this is configured, the primary Puppet server uses msgpack when serving any agents that have preferred_serialization_format set to msgpack. Any agents without that setting continue to receive JSON as normal.