From aee97cffd662ac21991517b6933a84409ca900b0 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 20 Jan 2014 14:01:29 +0100 Subject: [PATCH 01/16] install proper packages Signed-off-by: Steven Armstrong --- cdist/conf/type/__apt_ppa/man.text | 7 +++++-- cdist/conf/type/__apt_ppa/manifest | 6 +++--- cdist/conf/type/__apt_ppa/parameter/default/state | 1 + cdist/conf/type/__apt_ppa/parameter/{required => optional} | 0 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 cdist/conf/type/__apt_ppa/parameter/default/state rename cdist/conf/type/__apt_ppa/parameter/{required => optional} (100%) diff --git a/cdist/conf/type/__apt_ppa/man.text b/cdist/conf/type/__apt_ppa/man.text index 6a5990d5..da18e9f0 100644 --- a/cdist/conf/type/__apt_ppa/man.text +++ b/cdist/conf/type/__apt_ppa/man.text @@ -16,7 +16,8 @@ This cdist type allows manage ubuntu ppa repositories. REQUIRED PARAMETERS ------------------- state:: - The state the ppa should be in, either "present" or "absent". + The state the ppa should be in, either 'present' or 'absent'. + Defaults to 'present' OPTIONAL PARAMETERS @@ -29,6 +30,8 @@ EXAMPLES -------------------------------------------------------------------------------- # Enable a ppa repository +__apt_ppa ppa:sans-intern/missing-bits +# same as __apt_ppa ppa:sans-intern/missing-bits --state present # Disable a ppa repository @@ -43,5 +46,5 @@ SEE ALSO COPYING ------- -Copyright \(C) 2011 Steven Armstrong. Free use of this software is +Copyright \(C) 2011-2014 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/__apt_ppa/manifest b/cdist/conf/type/__apt_ppa/manifest index e7ad0c26..2d91942b 100755 --- a/cdist/conf/type/__apt_ppa/manifest +++ b/cdist/conf/type/__apt_ppa/manifest @@ -1,6 +1,6 @@ #!/bin/sh # -# 2011 Steven Armstrong (steven-cdist at armstrong.cc) +# 2011-2014 Steven Armstrong (steven-cdist at armstrong.cc) # # This file is part of cdist. # @@ -20,9 +20,9 @@ name="$__object_id" -__package python-software-properties --state present +__package software-properties-common -require="__package/python-software-properties" \ +require="__package/software-properties-common" \ __file /usr/local/bin/remove-apt-repository \ --source "$__type/files/remove-apt-repository" \ --mode 0755 diff --git a/cdist/conf/type/__apt_ppa/parameter/default/state b/cdist/conf/type/__apt_ppa/parameter/default/state new file mode 100644 index 00000000..e7f6134f --- /dev/null +++ b/cdist/conf/type/__apt_ppa/parameter/default/state @@ -0,0 +1 @@ +present diff --git a/cdist/conf/type/__apt_ppa/parameter/required b/cdist/conf/type/__apt_ppa/parameter/optional similarity index 100% rename from cdist/conf/type/__apt_ppa/parameter/required rename to cdist/conf/type/__apt_ppa/parameter/optional From 92e67182a65c9421dc1a65e5de545c18bca46606 Mon Sep 17 00:00:00 2001 From: Daniel Heule Date: Tue, 21 Jan 2014 22:24:35 +0100 Subject: [PATCH 02/16] parameter default handling in __cdist type corrected --- cdist/conf/type/__cdist/manifest | 18 +++--------------- .../conf/type/__cdist/parameter/default/branch | 1 + .../conf/type/__cdist/parameter/default/source | 1 + .../type/__cdist/parameter/default/username | 1 + 4 files changed, 6 insertions(+), 15 deletions(-) create mode 100644 cdist/conf/type/__cdist/parameter/default/branch create mode 100644 cdist/conf/type/__cdist/parameter/default/source create mode 100644 cdist/conf/type/__cdist/parameter/default/username diff --git a/cdist/conf/type/__cdist/manifest b/cdist/conf/type/__cdist/manifest index 44d62f6c..7c0ae60e 100755 --- a/cdist/conf/type/__cdist/manifest +++ b/cdist/conf/type/__cdist/manifest @@ -27,23 +27,11 @@ else shell="" fi -if [ -f "$__object/parameter/username" ]; then - username="$(cat "$__object/parameter/username")" -else - username="cdist" -fi +username="$(cat "$__object/parameter/username")" -if [ -f "$__object/parameter/branch" ]; then - branch="$(cat "$__object/parameter/branch")" -else - branch="master" -fi +branch="$(cat "$__object/parameter/branch")" -if [ -f "$__object/parameter/source" ]; then - source="$(cat "$__object/parameter/source")" -else - source="git://github.com/telmich/cdist.git" -fi +source="$(cat "$__object/parameter/source")" # Currently hardcoded - if anyone cares, make a parameter # out of it diff --git a/cdist/conf/type/__cdist/parameter/default/branch b/cdist/conf/type/__cdist/parameter/default/branch new file mode 100644 index 00000000..1f7391f9 --- /dev/null +++ b/cdist/conf/type/__cdist/parameter/default/branch @@ -0,0 +1 @@ +master diff --git a/cdist/conf/type/__cdist/parameter/default/source b/cdist/conf/type/__cdist/parameter/default/source new file mode 100644 index 00000000..d669308f --- /dev/null +++ b/cdist/conf/type/__cdist/parameter/default/source @@ -0,0 +1 @@ +git://github.com/telmich/cdist.git diff --git a/cdist/conf/type/__cdist/parameter/default/username b/cdist/conf/type/__cdist/parameter/default/username new file mode 100644 index 00000000..a585e141 --- /dev/null +++ b/cdist/conf/type/__cdist/parameter/default/username @@ -0,0 +1 @@ +cdist From 02c3fe49887d75d28d581221cf51eeaf00e66379 Mon Sep 17 00:00:00 2001 From: Daniel Heule Date: Tue, 21 Jan 2014 22:33:10 +0100 Subject: [PATCH 03/16] parameter default handling in __qemu_img type corrected --- cdist/conf/type/__qemu_img/gencode-remote | 6 ++---- cdist/conf/type/__qemu_img/manifest | 6 ++---- cdist/conf/type/__qemu_img/parameter/default/format | 1 + cdist/conf/type/__qemu_img/parameter/default/state | 1 + cdist/conf/type/__qemu_img/parameter/optional | 1 + 5 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 cdist/conf/type/__qemu_img/parameter/default/format create mode 100644 cdist/conf/type/__qemu_img/parameter/default/state diff --git a/cdist/conf/type/__qemu_img/gencode-remote b/cdist/conf/type/__qemu_img/gencode-remote index 2a76cf8f..6e4bb4d0 100644 --- a/cdist/conf/type/__qemu_img/gencode-remote +++ b/cdist/conf/type/__qemu_img/gencode-remote @@ -2,8 +2,7 @@ # State: absent is handled by manifest - we need only to do stuff if image is # not existing and state != absent # -state="present" -[ -f "$__object/parameter/state" ] && state="$(cat "$__object/parameter/state")" +state="$(cat "$__object/parameter/state")" [ "$state" = "absent" ] && exit 0 exists="$(cat "$__object/explorer/exists")" @@ -13,8 +12,7 @@ exists="$(cat "$__object/explorer/exists")" # Still there? Create image # -format=qcow2 -[ -f "$__object/parameter/format" ] && format="$(cat "$__object/parameter/format")" +format="$(cat "$__object/parameter/format")" size="$(cat "$__object/parameter/size")" diskimage="/$__object_id" diff --git a/cdist/conf/type/__qemu_img/manifest b/cdist/conf/type/__qemu_img/manifest index b835301d..6d50037f 100644 --- a/cdist/conf/type/__qemu_img/manifest +++ b/cdist/conf/type/__qemu_img/manifest @@ -2,10 +2,8 @@ # Default settings # -format=qcow2 -state=present -[ -f "$__object/parameter/format" ] && format="$(cat "$__object/parameter/format")" -[ -f "$__object/parameter/state" ] && state="$(cat "$__object/parameter/state")" +format="$(cat "$__object/parameter/format")" +state="$(cat "$__object/parameter/state")" diskimage="/$__object_id" diff --git a/cdist/conf/type/__qemu_img/parameter/default/format b/cdist/conf/type/__qemu_img/parameter/default/format new file mode 100644 index 00000000..e0a90ab9 --- /dev/null +++ b/cdist/conf/type/__qemu_img/parameter/default/format @@ -0,0 +1 @@ +qcow2 diff --git a/cdist/conf/type/__qemu_img/parameter/default/state b/cdist/conf/type/__qemu_img/parameter/default/state new file mode 100644 index 00000000..e7f6134f --- /dev/null +++ b/cdist/conf/type/__qemu_img/parameter/default/state @@ -0,0 +1 @@ +present diff --git a/cdist/conf/type/__qemu_img/parameter/optional b/cdist/conf/type/__qemu_img/parameter/optional index 0e8469e7..71b9a32b 100644 --- a/cdist/conf/type/__qemu_img/parameter/optional +++ b/cdist/conf/type/__qemu_img/parameter/optional @@ -1 +1,2 @@ format +state From 08b8270739b7a17778d5e5427d6635b65ba1484a Mon Sep 17 00:00:00 2001 From: Daniel Heule Date: Tue, 21 Jan 2014 22:45:35 +0100 Subject: [PATCH 04/16] parameter default handling in __zypper_service type corrected --- cdist/conf/type/__zypper_service/gencode-remote | 13 ++----------- cdist/conf/type/__zypper_service/manifest | 6 +----- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/cdist/conf/type/__zypper_service/gencode-remote b/cdist/conf/type/__zypper_service/gencode-remote index d11749ae..df8d1660 100644 --- a/cdist/conf/type/__zypper_service/gencode-remote +++ b/cdist/conf/type/__zypper_service/gencode-remote @@ -39,17 +39,8 @@ else uri="$__object_id" fi -if [ -f "$__object/parameter/state" ]; then - state_should="$(cat "$__object/parameter/state")" -else - state_should="present" -fi - -if [ -f "$__object/parameter/type" ]; then - stype="$(cat "$__object/parameter/type")" -else - stype="ris" -fi +state_should="$(cat "$__object/parameter/state")" +stype="$(cat "$__object/parameter/type")" exp_uri="$(cat "$__object/explorer/service_uri")" exp_id="$(cat "$__object/explorer/service_id")" diff --git a/cdist/conf/type/__zypper_service/manifest b/cdist/conf/type/__zypper_service/manifest index d8773605..aa4a39a3 100644 --- a/cdist/conf/type/__zypper_service/manifest +++ b/cdist/conf/type/__zypper_service/manifest @@ -33,11 +33,7 @@ else uri="$__object_id" fi -if [ -f "$__object/parameter/state" ]; then - state_should="$(cat "$__object/parameter/state")" -else - state_should="present" -fi +state_should="$(cat "$__object/parameter/state")" exp_uri="$(cat "$__object/explorer/service_uri")" From 360b42e89219d088b4bfb24db610672111f7b9bd Mon Sep 17 00:00:00 2001 From: Daniel Heule Date: Tue, 21 Jan 2014 22:57:06 +0100 Subject: [PATCH 05/16] parameter default handling in __zypper_repo type corrected --- cdist/conf/type/__zypper_repo/gencode-remote | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cdist/conf/type/__zypper_repo/gencode-remote b/cdist/conf/type/__zypper_repo/gencode-remote index 4d834c47..f678552b 100644 --- a/cdist/conf/type/__zypper_repo/gencode-remote +++ b/cdist/conf/type/__zypper_repo/gencode-remote @@ -45,11 +45,7 @@ else id="$__object_id" fi -if [ -f "$__object/parameter/state" ]; then - state="$(cat "$__object/parameter/state")" -else - state="present" -fi +state="$(cat "$__object/parameter/state")" repo_id="$(cat "$__object/explorer/repo_id")" From b75481a4d41cb45c25cccdf2bfb053a10e7b9ede Mon Sep 17 00:00:00 2001 From: Daniel Heule Date: Tue, 21 Jan 2014 23:18:10 +0100 Subject: [PATCH 06/16] parameter default handling in __key_value type corrected --- cdist/conf/type/__key_value/gencode-remote | 4 ++-- cdist/conf/type/__key_value/manifest | 3 +-- cdist/conf/type/__key_value/parameter/default/state | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 cdist/conf/type/__key_value/parameter/default/state diff --git a/cdist/conf/type/__key_value/gencode-remote b/cdist/conf/type/__key_value/gencode-remote index ec91894f..b79d9688 100755 --- a/cdist/conf/type/__key_value/gencode-remote +++ b/cdist/conf/type/__key_value/gencode-remote @@ -21,8 +21,8 @@ key="$__object_id" [ -f "$__object/parameter/key" ] && key="$(cat "$__object/parameter/key")" -state_should=present -[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")" + +state_should="$(cat "$__object/parameter/state")" file="$(cat "$__object/parameter/file")" delimiter="$(cat "$__object/parameter/delimiter")" diff --git a/cdist/conf/type/__key_value/manifest b/cdist/conf/type/__key_value/manifest index 8ed9cc9c..56f4c874 100755 --- a/cdist/conf/type/__key_value/manifest +++ b/cdist/conf/type/__key_value/manifest @@ -19,8 +19,7 @@ # along with cdist. If not, see . # -state_should=present -[ -f "$__object/parameter/state" ] && state_should="$(cat "$__object/parameter/state")" +state_should="$(cat "$__object/parameter/state")" if [ "$state_should" = "present" -a ! -f "$__object/parameter/value" ]; then echo "Missing required parameter 'value'" >&2 diff --git a/cdist/conf/type/__key_value/parameter/default/state b/cdist/conf/type/__key_value/parameter/default/state new file mode 100644 index 00000000..e7f6134f --- /dev/null +++ b/cdist/conf/type/__key_value/parameter/default/state @@ -0,0 +1 @@ +present From 0e49ccbf4369acc66b351b984685ad35a064de3e Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 22 Jan 2014 00:44:56 +0100 Subject: [PATCH 07/16] ++changes Signed-off-by: Nico Schottelius --- docs/changelog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/changelog b/docs/changelog index 242f92b0..4addc772 100644 --- a/docs/changelog +++ b/docs/changelog @@ -9,7 +9,12 @@ Changelog * Core: Add environment variable to select shell for executing scripts (Daniel Heule) * Explorer hostname: Return host name by using uname -n * New Type: __hostname (Steven Armstrong) + * Type __cdist: Use default paremeters (Daniel Heule) + * Type __key_value: Use default paremeters (Daniel Heule) * Type __line: Use printf instead of echo for printing user input + * Type __qemu_img: Use default paremeters (Daniel Heule) + * Type __zypper_repo: Use default paremeters (Daniel Heule) + * Type __zypper_service: Use default paremeters (Daniel Heule) 3.0.2: 2014-01-19 * Documentation: Document all messages sent by types (Daniel Heule) From 87d72dfc1a7b6c4a8c2d0bbd77c6188dac8555fa Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 22 Jan 2014 00:46:35 +0100 Subject: [PATCH 08/16] release: 3.0.3 Signed-off-by: Nico Schottelius --- docs/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog b/docs/changelog index 4addc772..d4100898 100644 --- a/docs/changelog +++ b/docs/changelog @@ -4,7 +4,7 @@ Changelog * Changes are always commented with their author in (braces) * Exception: No braces means author == Nico Schottelius -3.0.3: +3.0.3: 2014-01-22 * Core: Enhance error message when requirement is missing object id * Core: Add environment variable to select shell for executing scripts (Daniel Heule) * Explorer hostname: Return host name by using uname -n From 7a0b3cd7b7d416d16ff34f03402110b6327cf8a0 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 22 Jan 2014 21:21:34 +0100 Subject: [PATCH 09/16] python-software-properties still needed for older ubuntu versions Signed-off-by: Steven Armstrong --- cdist/conf/type/__apt_ppa/manifest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cdist/conf/type/__apt_ppa/manifest b/cdist/conf/type/__apt_ppa/manifest index 2d91942b..1d90e9c4 100755 --- a/cdist/conf/type/__apt_ppa/manifest +++ b/cdist/conf/type/__apt_ppa/manifest @@ -21,8 +21,9 @@ name="$__object_id" __package software-properties-common +__package python-software-properties -require="__package/software-properties-common" \ +require="__package/software-properties-common __package/python-software-properties" \ __file /usr/local/bin/remove-apt-repository \ --source "$__type/files/remove-apt-repository" \ --mode 0755 From a62e4aade352cc4786a1240ef8b5912234e1c856 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 22 Jan 2014 22:07:12 +0100 Subject: [PATCH 10/16] ++changes Signed-off-by: Nico Schottelius --- docs/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/changelog b/docs/changelog index d4100898..d8af2cf3 100644 --- a/docs/changelog +++ b/docs/changelog @@ -4,6 +4,9 @@ Changelog * Changes are always commented with their author in (braces) * Exception: No braces means author == Nico Schottelius +3.0.4: + * Type __apt_ppa: Install required software (Steven Armstrong) + 3.0.3: 2014-01-22 * Core: Enhance error message when requirement is missing object id * Core: Add environment variable to select shell for executing scripts (Daniel Heule) From 78be159eb789dfef83421cff5703d0b54f25c904 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 27 Jan 2014 14:15:41 +0100 Subject: [PATCH 11/16] update reference: we also do not touch 'files' in the object Signed-off-by: Nico Schottelius --- docs/man/cdist-reference.text.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/man/cdist-reference.text.sh b/docs/man/cdist-reference.text.sh index a72452eb..5c9f603c 100755 --- a/docs/man/cdist-reference.text.sh +++ b/docs/man/cdist-reference.text.sh @@ -131,7 +131,8 @@ confdir/type//explorer:: confdir/type//files:: This directory is reserved for user data and will not be used - by cdist at any time + by cdist at any time. It can be used for storing supplementary + files (like scripts to act as a template or configuration files). out/:: This directory contains output of cdist and is usually located @@ -175,9 +176,16 @@ OBJECTS For object to object communication and tests, the following paths are usable within a object directory: +files:: + This directory is reserved for user data and will not be used + by cdist at any time. It can be used freely by the type + (for instance to store template results). changed:: This empty file exists in an object directory, if the object has code to be excuted (either remote or local) +stdin:: + This file exists and contains data, if data was provided on stdin + when the type was called. ENVIRONMENT VARIABLES From 9049a1421cfd5b5e8f4ee72e79178ab90dce681c Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 27 Jan 2014 14:17:51 +0100 Subject: [PATCH 12/16] support --file - in __debconf_set_selections Signed-off-by: Nico Schottelius --- .../conf/type/__debconf_set_selections/gencode-remote | 10 ++++++++-- cdist/conf/type/__debconf_set_selections/man.text | 7 ++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cdist/conf/type/__debconf_set_selections/gencode-remote b/cdist/conf/type/__debconf_set_selections/gencode-remote index 62be6a12..4892ec25 100755 --- a/cdist/conf/type/__debconf_set_selections/gencode-remote +++ b/cdist/conf/type/__debconf_set_selections/gencode-remote @@ -1,6 +1,6 @@ #!/bin/sh # -# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011-2014 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -21,6 +21,12 @@ # Setup selections # +filename"$(cat "$__object/parameter/file")" + +if [ "$filename" = "-" ]; then + filename="$__object/stdin" +fi + echo "debconf-set-selections << __file-eof" -cat "$(cat "$__object/parameter/file")" +cat "$(cat "$filename")" echo "__file-eof" diff --git a/cdist/conf/type/__debconf_set_selections/man.text b/cdist/conf/type/__debconf_set_selections/man.text index f1e13a8e..e36ebaa3 100644 --- a/cdist/conf/type/__debconf_set_selections/man.text +++ b/cdist/conf/type/__debconf_set_selections/man.text @@ -18,6 +18,7 @@ REQUIRED PARAMETERS ------------------- file:: Use the given filename as input for debconf-set-selections(1) + If filename is "-", read from stdin. EXAMPLES @@ -29,6 +30,10 @@ __debconf_set_selections nslcd --file /path/to/file # Setup configuration for nslcd from another type __debconf_set_selections nslcd --file "$__type/files/preseed/nslcd" + +__debconf_set_selections nslcd --file - << eof +gitolite gitolite/gituser string git +eof -------------------------------------------------------------------------------- @@ -41,5 +46,5 @@ SEE ALSO COPYING ------- -Copyright \(C) 2011-2013 Nico Schottelius. Free use of this software is +Copyright \(C) 2011-2014 Nico Schottelius. Free use of this software is granted under the terms of the GNU General Public License version 3 (GPLv3). From 565e11b16dc53c0d887c4060940c7bffb2e581d5 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 27 Jan 2014 14:18:56 +0100 Subject: [PATCH 13/16] ++changes Signed-off-by: Nico Schottelius --- docs/changelog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/changelog b/docs/changelog index d8af2cf3..d9c2c8b5 100644 --- a/docs/changelog +++ b/docs/changelog @@ -5,7 +5,10 @@ Changelog * Exception: No braces means author == Nico Schottelius 3.0.4: + * Documentation: Update reference (files path in object space) * Type __apt_ppa: Install required software (Steven Armstrong) + * Type __debconf_set_selections: Support --file - to read from stdin + 3.0.3: 2014-01-22 * Core: Enhance error message when requirement is missing object id @@ -19,6 +22,7 @@ Changelog * Type __zypper_repo: Use default paremeters (Daniel Heule) * Type __zypper_service: Use default paremeters (Daniel Heule) + 3.0.2: 2014-01-19 * Documentation: Document all messages sent by types (Daniel Heule) * New Type: __block (Steven Armstrong) From 723be34bca37e97cb7cf3d94367d5e224ec7b325 Mon Sep 17 00:00:00 2001 From: Jake Guffey Date: Mon, 27 Jan 2014 13:22:03 -0500 Subject: [PATCH 14/16] Fixed typo Was assigning jaildir=$object/parameter/name, fixed to $object/parameter/jaildir --- cdist/conf/type/__jail/gencode-local | 2 +- cdist/conf/type/__jail/gencode-remote | 2 +- cdist/conf/type/__jail/manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cdist/conf/type/__jail/gencode-local b/cdist/conf/type/__jail/gencode-local index 075a6ef1..d6384156 100755 --- a/cdist/conf/type/__jail/gencode-local +++ b/cdist/conf/type/__jail/gencode-local @@ -23,7 +23,7 @@ # if [ -f "$__object/parameter/jaildir" ]; then - jaildir="$(cat "$__object/parameter/name")" + jaildir="$(cat "$__object/parameter/jaildir")" else jaildir="/usr/jail" fi diff --git a/cdist/conf/type/__jail/gencode-remote b/cdist/conf/type/__jail/gencode-remote index b044e4b0..afbb81a5 100755 --- a/cdist/conf/type/__jail/gencode-remote +++ b/cdist/conf/type/__jail/gencode-remote @@ -85,7 +85,7 @@ if [ -f "$__object/parameter/onboot" ]; then fi if [ -f "$__object/parameter/jaildir" ]; then - jaildir="$(cat "$__object/parameter/name")" + jaildir="$(cat "$__object/parameter/jaildir")" else jaildir="/usr/jail" fi diff --git a/cdist/conf/type/__jail/manifest b/cdist/conf/type/__jail/manifest index 0570d62d..cf5b7938 100755 --- a/cdist/conf/type/__jail/manifest +++ b/cdist/conf/type/__jail/manifest @@ -34,7 +34,7 @@ if [ ! "$os" = "freebsd" ]; then fi if [ -f "$__object/parameter/jaildir" ]; then - jaildir="$(cat "$__object/parameter/name")" + jaildir="$(cat "$__object/parameter/jaildir")" else jaildir="/usr/jail" fi From e52a059adfbb2152d33f0cb9e7c1516db9e00188 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Mon, 27 Jan 2014 19:38:26 +0100 Subject: [PATCH 15/16] ++changes Signed-off-by: Nico Schottelius --- docs/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog b/docs/changelog index d9c2c8b5..34e44913 100644 --- a/docs/changelog +++ b/docs/changelog @@ -8,6 +8,7 @@ Changelog * Documentation: Update reference (files path in object space) * Type __apt_ppa: Install required software (Steven Armstrong) * Type __debconf_set_selections: Support --file - to read from stdin + * Type __jail: Fix jaildir parameter handling (Jake Guffey) 3.0.3: 2014-01-22 From aa3e92f07b9ff91b298064ba8b6173ad0a1dcea6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 29 Jan 2014 21:08:22 +0100 Subject: [PATCH 16/16] use directory files/, not templates Signed-off-by: Nico Schottelius --- docs/man/man7/cdist-best-practice.text | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/man/man7/cdist-best-practice.text b/docs/man/man7/cdist-best-practice.text index e6685cad..a818be60 100644 --- a/docs/man/man7/cdist-best-practice.text +++ b/docs/man/man7/cdist-best-practice.text @@ -164,8 +164,8 @@ For more details consult sudoers(5) TEMPLATING ---------- -* create directory templates/ in your type (convention) -* create the template as an executable file like templates/basic.conf.sh, it will output text using shell variables for the values +* create directory files/ in your type (convention) +* create the template as an executable file like files/basic.conf.sh, it will output text using shell variables for the values -------------------------------------------------------------------------------- #!/bin/sh @@ -191,7 +191,7 @@ EOF export ROOT='/var/www/test' # render the template mkdir -p "$__object/files" - "$__type/templates/basic.conf.sh" > "$__object/files/basic.conf" + "$__type/files/basic.conf.sh" > "$__object/files/basic.conf" # send the rendered template __file /etc/nginx/sites-available/test.conf \ --state present