Adde WIP type, broken atm

This commit is contained in:
llnu 2020-05-06 12:01:28 +02:00
parent f20ce1e3c3
commit 1bdcbd38bb
4 changed files with 29 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -0,0 +1 @@
colour