a whole bunch of lint and style fixes

This commit is contained in:
Gareth Rushgrove 2013-11-26 10:06:42 +00:00
Родитель a3586be43c
Коммит ded140e36a
7 изменённых файлов: 58 добавлений и 17 удалений

Просмотреть файл

@ -64,8 +64,8 @@ You can also remove images you no longer need with:
}
docker::image { 'ubuntu':
ensure => 'absent',
image_tag => 'precise'
ensure => 'absent',
image_tag => 'precise'
}
### Containers

Просмотреть файл

@ -1,2 +1,4 @@
# == Class: docker::config
#
class docker::config {
}

Просмотреть файл

@ -1,22 +1,39 @@
# == Class: docker
#
# Module to install an up-to-date version of Docker from the
# official Apt repository. The use of this repository means, this module works
# only on Debian based distributions.
#
# === Parameters
# [*ensure*]
# Whether you want the image present or absent.
#
# [*image*]
# If you want the name of the image to be different from the
# name of the puppet resource you can pass a value here.
#
# [*image_tag*]
# If you want a specific tag of the image to be installed
#
#
define docker::image(
$ensure = 'present',
$image = $title,
$image_tag = undef
$ensure = 'present',
$image = $title,
$image_tag = undef
) {
validate_re($ensure, '^(present|absent)$')
validate_re($image, '^[\S]*$')
if $image_tag {
$image_install = "docker pull -t=\"${image_tag}\" ${image}"
$image_remove = "docker rmi ${image}:${image_tag}"
$image_find = "docker images | grep ^${image} | awk '{ print \$2 }' | grep ${image_tag}"
} else {
$image_install = "docker pull ${image}"
$image_remove = "docker rmi ${image}"
$image_find = "docker images | grep ^${image}"
}
if $image_tag {
$image_install = "docker pull -t=\"${image_tag}\" ${image}"
$image_remove = "docker rmi ${image}:${image_tag}"
$image_find = "docker images | grep ^${image} | awk '{ print \$2 }' | grep ${image_tag}"
} else {
$image_install = "docker pull ${image}"
$image_remove = "docker rmi ${image}"
$image_find = "docker images | grep ^${image}"
}
if $ensure == 'absent' {
exec { $image_remove:

Просмотреть файл

@ -48,11 +48,11 @@ class docker::install {
if $docker::version {
$dockerpackage = "lxc-docker-${docker::version}"
} else {
$dockerpackage = "lxc-docker"
$dockerpackage = 'lxc-docker'
}
package { 'lxc-docker':
name => $dockerpackage,
ensure => $docker::ensure,
name => $dockerpackage,
}
}

Просмотреть файл

@ -1,3 +1,7 @@
# == Class: docker::paramrs
#
# Defaut parameter values for the docker module
#
class docker::params {
$version = undef
$ensure = present

Просмотреть файл

@ -1,3 +1,7 @@
# == Define: docker:run
#
# A define which manages an upstart managed docker container
#
define docker::run(
$image,
$command,

Просмотреть файл

@ -1,3 +1,17 @@
# == Class: docker::service
#
# Class to manage the docker service daemon
#
# === Parameters
# [*tcp_bind*]
# Which tcp port, if any, to bind the docker service to.
#
# [*socket_bind*]
# Which local unix socket to bind the docker service to.
#
# [*root_dir*]
# Specify a non-standard root directory for docker.
#
class docker::service (
$tcp_bind = $docker::tcp_bind,
$socket_bind = $docker::socket_bind,