Adde WIP type, broken atm
This commit is contained in:
parent
f20ce1e3c3
commit
1bdcbd38bb
4 changed files with 29 additions and 0 deletions
9
balazs/dot-cdist/type/__colorful_file/man
Normal file
9
balazs/dot-cdist/type/__colorful_file/man
Normal 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
|
13
balazs/dot-cdist/type/__colorful_file/manifest
Normal file
13
balazs/dot-cdist/type/__colorful_file/manifest
Normal 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
|
6
balazs/dot-cdist/type/__colorful_file/manifest~
Normal file
6
balazs/dot-cdist/type/__colorful_file/manifest~
Normal 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
|
1
balazs/dot-cdist/type/__colorful_file/parameter/optional
Normal file
1
balazs/dot-cdist/type/__colorful_file/parameter/optional
Normal file
|
@ -0,0 +1 @@
|
|||
colour
|
Loading…
Reference in a new issue