Published on 24 February 2016 by

With the general availability of Docker Universal Control Plane (UCP) this week, Puppet Labs is pleased to announce the release of a corresponding Puppet module, docker_ucp. The Docker UCP provides a great user interface for managing containers in your cluster, and getting UCP up and running across all of your Docker hosts couldn’t be easier when you use the Puppet module.

The controller

The docker_ucp module assumes you already have a Docker daemon set up and running on the node. You can use the puppetlabs/docker_platform module to do just that, but it’s not a requirement.

In the simplest case, setting up a Docker UCP controller just means including the following class:

class { 'docker_ucp':
  controller => true,

This will use the docker/ucp container to bootstrap a new Docker UCP controller on the standard ports, and with the default username and password. Docker UCP has a number of options you can pass when setting up a new controller, and the module takes those as parameters. For example, here's what you'd do for a much more complicated setup:

class { 'docker_ucp':
  controller                => true,
  host_address              => ::ipaddress_eth1,
  version                   => '0.8.0',
  usage                     => false,
  tracking                  => false,
  subject_alternative_names => ::ipaddress_eth1,
  external_ca               => false,
  swarm_scheduler           => 'binpack',
  swarm_port                => 19001,
  controller_port           => 19002,
  preserve_certs            => true,
  docker_socket_path        => '/var/run/docker.sock',
  license_file              => '/etc/docker/subscription.lic',

Adding nodes

Once you have a controller, you’ll probably want to join a few nodes to it and take advantage of the built-in Docker Swarm cluster. For this you’ll need the URL to your Docker UCP controller and the associated fingerprint. You can get the fingerprint by running the docker/ucp container on your controller:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock --name ucp docker/ucp fingerprint

You’ll also need to have installed a valid license on the UCP controller, either by adding the license through the web interface or by passing the license_file parameter shown above.

Now provide that fingerprint to the docker_ucp class, this time without passing the controller parameter:

class { 'docker_ucp':
  ucp_url     => '',
  fingerprint => 'the-ucp-fingerprint-for-your-install',

Docker recommends creating a few controller replicas to maintain a high-availability setup. You can make a node a controller replica when you create it by passing a replica parameter, too:

class { 'docker_ucp':
  ucp_url     => '',
  fingerprint => 'the-ucp-fingerprint-for-your-install',
  replica     => true,


The module is currently tested with Ubuntu 14.04 and Centos 7, which are the platforms currently supported by Docker for running Universal Control Plane. The module is not yet on the supported list for Puppet Enterprise customers, but if you’re a Puppet Enterprise user who’s using Docker, do let us know if you find this module useful.

Next steps

You can check out the source code for the new module on GitHub and download the module from the Puppet Forge. Any questions about the module, or about working with Docker and Puppet do ask the Puppet community.

Gareth Rushgrove is a senior software developer at Puppet Labs.

Learn more

Share via:
The content of this field is kept private and will not be shown publicly.

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.