Comments (7)
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.
from garethr-docker.
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.
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.
from garethr-docker.
any idea why it cannot find docker-ce
from garethr-docker.
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)
- docker::run ensure=> 'absent' inconsistent HOT 1
- env attribute does not work when a "-" is present HOT 4
- Using registry mirror
- CentOS/7 : Having "INSECURE_REGISTRY" option HOT 1
- Use docker::swarm as an exported resource HOT 5
- Error while evaluating a Resource Statement, Apt::Source[docker] HOT 3
- docker image, docker_tar and restart containers only on update? HOT 4
- Allow Docker to configure direct-lvm mode
- Connecting to Docker Hub HOT 1
- RHEL 7 extra repository error
- Support docker-ce
- Please mark this module as deprecated and redirect to puppetlabs/puppetlabs-docker HOT 1
- Amazon Linux 2 support HOT 2
- Ubuntu: Install docker-ce instead of docker-engine? HOT 1
- Notice of Newer PuppetLabs Module HOT 1
- Docker registry auth doesn't check if it authed already? HOT 1
- $docker::service_provider is not respected by docker::run HOT 1
- support for Centos 8 HOT 1
- Please point users of this module to https://github.com/puppetlabs/puppetlabs-docker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from garethr-docker.