A collection of task oriented solutions in Puppet

 

Install Docker

Challenge

You want to install Docker

Solution

First install the docker module from the puppet forge:

# install the docker module
$ sudo /opt/puppetlabs/bin/puppet module install garethr-docker

...
Notice: Installing -- do not interrupt ...
/etc/puppetlabs/code/environments/production/site
  garethr-docker (v5.3.0)
...

Then use it in your puppet manifests:

class install_docker {

  # simple install with all the default options
  include ::docker

  # or you can customise the install
  class { 'docker' :
    manage_package => true,
    package_name   => 'docker-engine',
  }

}

Explanation

The simplest way to install Docker is to first install the Puppet Forge Docker Module and then include it in your manifests.

class install_docker {

  # simple install with all the default options
  include ::docker

  # or you can customise the install
  class { 'docker' :
    manage_package => true,
    package_name   => 'docker-engine',
  }

}

If you need to configure how the docker daemon is installed or configured you should read the docker module configuration options. The module is quite a flexible one and can probably be tailored to your use case without needing to change the module code itself.

See also