Code Monkey home page Code Monkey logo

Comments (7)

Justin-DynamicD avatar Justin-DynamicD commented on June 30, 2024

You need to update your repo. The defautl repo in this module is out of date.

So for example, in ubuntu my hiera.yaml contains:

docker_package_name: 'docker-ce'
docker_package_source_location: 'https://download.docker.com/linux/centos/docker-ce.repo'

from garethr-docker.

rohitbordia avatar rohitbordia commented on June 30, 2024

from garethr-docker.

Justin-DynamicD avatar Justin-DynamicD commented on June 30, 2024

as an fyi, this seems to have been forked by the puppet team, This module may be on it's way to pasture:

https://forge.puppet.com/puppetlabs/docker

from garethr-docker.

Justin-DynamicD avatar Justin-DynamicD commented on June 30, 2024

I'm sorry, I forgot my hiera doesn't translate properly ... let me do this again in puppet DSL:

package_name => $docker_package_name, package_source_location => $docker_package_source_location,

Hope that's a bit more clear.

from garethr-docker.

rohitbordia avatar rohitbordia commented on June 30, 2024

from garethr-docker.

rohitbordia avatar rohitbordia commented on June 30, 2024

any idea why it cannot find docker-ce

from garethr-docker.

davidius81 avatar davidius81 commented on June 30, 2024

Yup, because your specified the Repo file instead of the yum url,

The module has still useful features but it doesn't support the new packages, specially because the $docker_command variable now differ from daemon_command and the module is not support it at the moment. So I decided to install the package myself and use the feature I want after.

Here is what I have done:

I kept my example simple but I have also enabled the tls in my environment.

my hiera data looks like this.

docker:
   daemon:
    experimental: true
    insecure-registries:
    - myrepostiroy:5000
    hosts:
    - tcp://0.0.0.0:2376
    - unix:///var/run/docker.sock
    storage-driver: devicemapper
    storage-opts:
    - dm.directlvm_device=/dev/sdc
    - dm.thinp_percent=95
    - dm.thinp_metapercent=1
    - dm.thinp_autoextend_threshold=80
    - dm.thinp_autoextend_percent=20
    - dm.directlvm_device_force=false
    log-driver: "json-file"
    log-opts:
      max-size: "10m"
      max-file: "3"

In my profile I fetch the configuration as follow:

Hash $docker_daemon   = hiera('docker.daemon',undef),
 
 # Convert my puppet hash to json
  $docker_daemon_template = @(END)
  <%= require "json"; JSON.pretty_generate @docker_daemon%>
  END

  file { '/etc/docker/daemon.json':
    ensure => file,
    owner  => root,
    group  => root,
    mode   => '644',
    content =>  inline_template($docker_daemon_template),
    notify  => Exec['Reload Docker Configuration'],
  }

  yumrepo { 'docker-ce-stable':
    descr    => 'Docker CE Stable - $basearch',
    baseurl  => 'https://download.docker.com/linux/centos/7/$basearch/stable',
    gpgkey   => 'https://download.docker.com/linux/centos/gpg',
    gpgcheck => true,
  }

  package { "docker-ce": 
    ensure => "installed",
    require => Yumrepo['docker-ce-stable'],
    }  

  service { "docker":
    ensure     => running,
    enable     => true,
    hasrestart => true,
    hasstatus  => true,
    require    => [
                    Package['docker-ce'],
                    File['/etc/docker/daemon.json'],
                  ],
  }

exec { 'Reload Docker Configuration':
    command => "/bin/systemctl reload docker",
    refreshonly => true,
  }

I hope this will help others!

Have fun:)

from garethr-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.