How do i set up docker with puppet

0 votes
I want to use puppetlabs/docker module in order to manage docker instances using puppet. Can somebody please help me with the setup required if I am using a Puppet 6.7 on an ubuntu machine ?  I have installed the puppetlabs/docker module already. Thanks.
Aug 13, 2019 in Puppet by Karan
• 19,610 points
2,610 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

After installing the docker module , setup is as follows:

To create the Docker hosted repository and install the Docker package, add a single class to the manifest file:

include docker

To configure package sources independently and disable automatically including sources, add the following code to the manifest file:

class { 'docker':
  use_upstream_package_source => false,
}

To ensure the module configures the latest repositories, add the following code to the manifest file:

class { 'docker':
  version => '17.09.0~ce-0~debian',
}

Docker provides a enterprise addition of the Docker Engine, called Docker EE.

To install Docker EE on RHEL/CentOS:

class { 'docker':
  docker_ee => true,
  docker_ee_source_location => 'https://<docker_ee_repo_url>',
  docker_ee_key_source => 'https://<docker_ee_key_source_url>',
}

For Red Hat Enterprise Linux (RHEL) based distributions, the docker module uses the upstream repositories. 

To use the CE packages, add the following code to the manifest file:

class { 'docker':
  use_upstream_package_source => false,
  repo_opt => '',
}

When setting up TLS, upload the related files (CA certificate, server certificate, and key) and include their paths in the manifest file:

class { 'docker':
  tcp_bind        => ['tcp://0.0.0.0:2376'],
  tls_enable      => true,
  tls_cacert      => '/etc/docker/tls/ca.pem',
  tls_cert        => '/etc/docker/tls/cert.pem',
  tls_key         => '/etc/docker/tls/key.pem',
}

To specify which Docker rpm package to install, add the following code to the manifest file:

class { 'docker':
  manage_package              => true,
  use_upstream_package_source => false,
  package_engine_name         => 'docker-engine'
  package_source_location     => 'https://get.docker.com/rpm/1.7.0/centos-6/RPMS/x86_64/docker-engine-1.7.0-1.el6.x86_64.rpm',
  prerequired_packages        => [ 'glibc.i686', 'glibc.x86_64', 'sqlite.i686', 'sqlite.x86_64', 'device-mapper', 'device-mapper-libs', 'device-mapper-event-libs', 'device-mapper-event' ]
}

For more info refer to: https://forge.puppet.com/puppetlabs/docker

answered Aug 13, 2019 by Sirajul
• 59,230 points

Related Questions In Puppet

0 votes
1 answer

Docker with Puppet: How do I install Docker EE on a Debian System?

Docker provides a enterprise addition of the ...READ MORE

answered Aug 16, 2019 in Puppet by Sirajul
• 59,230 points
650 views
0 votes
1 answer

Docker with Puppet: How do i run the following command "docker build -t ubuntu /tmp/ubuntu_image" using puppet code?

 Hey @Liana, Including the docker_dir parameter is equivalent to ...READ MORE

answered Aug 16, 2019 in Puppet by Sirajul
• 59,230 points
1,002 views
0 votes
1 answer

Puppet+Docker: How do i configure my docker container to use a NFS volume?

docker_volume { 'nfs-volume': ensure => ...READ MORE

answered Aug 13, 2019 in Puppet by Sirajul
• 59,230 points
744 views
0 votes
1 answer

Puppet+Docker: How do i configure my docker container to use a NFS volume through a Hiera config file?

If using Hiera, configure the docker::volumes class in the ...READ MORE

answered Aug 14, 2019 in Puppet by Sirajul
• 59,230 points
926 views
0 votes
1 answer

Puppet+Docker: How do i configure a swarm if i am using windows server 2016.

There are a few considerations to be ...READ MORE

answered Aug 16, 2019 in Puppet by Sirajul
• 59,230 points
913 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,715 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP