From 3054bae8c2cd847b29416027ecfd38235309b4ab Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Fri, 2 Dec 2016 14:34:01 +0100 Subject: [PATCH 1/3] Added __docker type from asteven, implemented debian support --- cdist/conf/type/__docker/man.text | 51 ++++++++++++++ cdist/conf/type/__docker/manifest | 81 ++++++++++++++++++++++ cdist/conf/type/__docker/parameter/boolean | 1 + cdist/conf/type/__docker/singleton | 0 4 files changed, 133 insertions(+) create mode 100644 cdist/conf/type/__docker/man.text create mode 100755 cdist/conf/type/__docker/manifest create mode 100644 cdist/conf/type/__docker/parameter/boolean create mode 100644 cdist/conf/type/__docker/singleton diff --git a/cdist/conf/type/__docker/man.text b/cdist/conf/type/__docker/man.text new file mode 100644 index 00000000..566c2f4c --- /dev/null +++ b/cdist/conf/type/__docker/man.text @@ -0,0 +1,51 @@ +cdist-type__docker(7) +===================== +Steven Armstrong + + +NAME +---- +cdist-type__docker - install docker-engine + + +DESCRIPTION +----------- +Installs latest docker-engine package from dockerproject.org. + + +REQUIRED PARAMETERS +------------------- +None. + + +OPTIONAL PARAMETERS +------------------- +None. + + +BOOLEAN PARAMETERS +------------------ +experimentel:: + Install the experimentel docker-engine package instead of the latest stable release. + + +EXAMPLES +-------- + +-------------------------------------------------------------------------------- +__docker + +# experimentel +__docker --experimental +-------------------------------------------------------------------------------- + + +SEE ALSO +-------- +- cdist-type(7) + + +COPYING +------- +Copyright \(C) 2016 Steven Armstrong. Free use of this software is +granted under the terms of the GNU General Public License version 3 (GPLv3). diff --git a/cdist/conf/type/__docker/manifest b/cdist/conf/type/__docker/manifest new file mode 100755 index 00000000..ba13b3e4 --- /dev/null +++ b/cdist/conf/type/__docker/manifest @@ -0,0 +1,81 @@ +#!/bin/sh +# +# 2016 Steven Armstrong (steven-cdist at armstrong.cc) +# +# This file is part of cdist. +# +# cdist is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# cdist is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with cdist. If not, see . +# + + +os=$(cat "$__global/explorer/os") + +case "$os" in + centos) + component="main" + if [ -f "$__object/parameter/experimental" ]; then + component="experimental" + fi + export CDIST_ORDER_DEPENDENCY=on + __yum_repo docker \ + --name 'Docker Repository' \ + --baseurl "https://yum.dockerproject.org/repo/$component/centos/\$releasever/" \ + --enabled \ + --gpgcheck \ + --gpgkey 'https://yum.dockerproject.org/gpg' + __package docker-engine + unset CDIST_ORDER_DEPENDENCY + ;; + ubuntu) + component="main" + if [ -f "$__object/parameter/experimental" ]; then + component="experimental" + fi + __package apparmor + __package ca-certificates + __package apt-transport-https + __apt_key docker --keyid 58118E89F3A912897C070ADBF76221572C52609D + export CDIST_ORDER_DEPENDENCY=on + __apt_source docker \ + --uri https://apt.dockerproject.org/repo \ + --distribution "ubuntu-$(cat "$__global/explorer/lsb_codename")" \ + --component "$component" + __package docker-engine + unset CDIST_ORDER_DEPENDENCY + ;; + debian) + component="main" + if [ -f "$__object/parameter/experimental" ]; then + component="experimental" + fi + + __package apt-transport-https + __package ca-certificates + __package gnupg2 + __apt_key docker --keyid 58118E89F3A912897C070ADBF76221572C52609D + export CDIST_ORDER_DEPENDENCY=on + __apt_source docker \ + --uri https://apt.dockerproject.org/repo \ + --distribution "debian-$(cat "$__global/explorer/lsb_codename")" \ + --component "$component" + __package docker-engine + unset CDIST_ORDER_DEPENDENCY + + ;; + *) + echo "Your operating system ($os) is currently not supported by this type (${__type##*/})." >&2 + echo "Please contribute an implementation for it if you can." >&2 + exit 1 + ;; +esac diff --git a/cdist/conf/type/__docker/parameter/boolean b/cdist/conf/type/__docker/parameter/boolean new file mode 100644 index 00000000..9839eb20 --- /dev/null +++ b/cdist/conf/type/__docker/parameter/boolean @@ -0,0 +1 @@ +experimental diff --git a/cdist/conf/type/__docker/singleton b/cdist/conf/type/__docker/singleton new file mode 100644 index 00000000..e69de29b From fc18e0f99cc57a2813bfe9c577566cfc5e4096ac Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Sat, 3 Dec 2016 18:14:58 +0100 Subject: [PATCH 2/3] migrated man.text -> man.rst --- .../conf/type/__docker/{man.text => man.rst} | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) rename cdist/conf/type/__docker/{man.text => man.rst} (71%) diff --git a/cdist/conf/type/__docker/man.text b/cdist/conf/type/__docker/man.rst similarity index 71% rename from cdist/conf/type/__docker/man.text rename to cdist/conf/type/__docker/man.rst index 566c2f4c..88786ad7 100644 --- a/cdist/conf/type/__docker/man.text +++ b/cdist/conf/type/__docker/man.rst @@ -1,7 +1,5 @@ cdist-type__docker(7) ===================== -Steven Armstrong - NAME ---- @@ -25,24 +23,23 @@ None. BOOLEAN PARAMETERS ------------------ -experimentel:: +experimentel Install the experimentel docker-engine package instead of the latest stable release. EXAMPLES -------- --------------------------------------------------------------------------------- -__docker +.. code-block:: sh + __docker -# experimentel -__docker --experimental --------------------------------------------------------------------------------- + # experimentel + __docker --experimental -SEE ALSO --------- -- cdist-type(7) +AUTHORS +------- +Steven Armstrong COPYING From 1ee6c2e7b1dbfe25d26f30a6648ce4d7f5336e1f Mon Sep 17 00:00:00 2001 From: Dominique Roux Date: Mon, 5 Dec 2016 07:57:30 +0100 Subject: [PATCH 3/3] added line after 33, changed experimentel to experimental --- cdist/conf/type/__docker/man.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__docker/man.rst b/cdist/conf/type/__docker/man.rst index 88786ad7..80088983 100644 --- a/cdist/conf/type/__docker/man.rst +++ b/cdist/conf/type/__docker/man.rst @@ -23,7 +23,7 @@ None. BOOLEAN PARAMETERS ------------------ -experimentel +experimental Install the experimentel docker-engine package instead of the latest stable release. @@ -31,6 +31,7 @@ EXAMPLES -------- .. code-block:: sh + __docker # experimentel