From 1bdcbd38bb66ee073188f8990b36a47668533126 Mon Sep 17 00:00:00 2001 From: llnu Date: Wed, 6 May 2020 12:01:28 +0200 Subject: [PATCH] Adde WIP type, broken atm --- balazs/dot-cdist/type/__colorful_file/man | 9 +++++++++ balazs/dot-cdist/type/__colorful_file/manifest | 13 +++++++++++++ balazs/dot-cdist/type/__colorful_file/manifest~ | 6 ++++++ .../type/__colorful_file/parameter/optional | 1 + 4 files changed, 29 insertions(+) create mode 100644 balazs/dot-cdist/type/__colorful_file/man create mode 100644 balazs/dot-cdist/type/__colorful_file/manifest create mode 100644 balazs/dot-cdist/type/__colorful_file/manifest~ create mode 100644 balazs/dot-cdist/type/__colorful_file/parameter/optional diff --git a/balazs/dot-cdist/type/__colorful_file/man b/balazs/dot-cdist/type/__colorful_file/man new file mode 100644 index 0000000..f933cf8 --- /dev/null +++ b/balazs/dot-cdist/type/__colorful_file/man @@ -0,0 +1,9 @@ +WIP + +This type creates a file with contents: +path: $__object_id +--colour: string + +Test it with: + +echo "__colorful_file /tmp/foo --colour red --colour blue" | cdist config -i - -c . -vv localhost diff --git a/balazs/dot-cdist/type/__colorful_file/manifest b/balazs/dot-cdist/type/__colorful_file/manifest new file mode 100644 index 0000000..5e04fc5 --- /dev/null +++ b/balazs/dot-cdist/type/__colorful_file/manifest @@ -0,0 +1,13 @@ +if [ -f "$__object/parameter/colour" ]; +then + while read -r 1 + do + __file "$__object_id" --source "$1" < /dev/null + echo "$1" >&2 + done < "$__object/parameter/colour" +#fi +#<< EOF +#colour="$(cat "$__object/parameter/colour")" +#EOF + else echo "Colour parameter is not supplied" ; exit 1 +fi \ No newline at end of file diff --git a/balazs/dot-cdist/type/__colorful_file/manifest~ b/balazs/dot-cdist/type/__colorful_file/manifest~ new file mode 100644 index 0000000..950e383 --- /dev/null +++ b/balazs/dot-cdist/type/__colorful_file/manifest~ @@ -0,0 +1,6 @@ +if [ -f "$__object/parameter/colour" ]; + then __file "$__object_id" --source << EOF +colour="$(cat "$__object/parameter/colour")" +EOF + else print "Colour parameter is not supplied" ; exit 1 +fi \ No newline at end of file diff --git a/balazs/dot-cdist/type/__colorful_file/parameter/optional b/balazs/dot-cdist/type/__colorful_file/parameter/optional new file mode 100644 index 0000000..b0d95fa --- /dev/null +++ b/balazs/dot-cdist/type/__colorful_file/parameter/optional @@ -0,0 +1 @@ +colour