|
|
|
@ -35,9 +35,13 @@ if [ ! -f "$__object/parameter/source" ] && [ ! -f "$__object/parameter/source-f |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
if [ -f "$__object/parameter/source-file" ]; then |
|
|
|
|
destination="${template_dir}/${name}" |
|
|
|
|
require="__file${destination}" |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Generate hcl config file |
|
|
|
|
# shellcheck disable=SC2031 |
|
|
|
|
( |
|
|
|
|
{ |
|
|
|
|
printf 'template {\n' |
|
|
|
|
cd "$__object/parameter/" |
|
|
|
|
for param in *; do |
|
|
|
@ -47,14 +51,11 @@ for param in *; do |
|
|
|
|
if [ "$source" = "-" ]; then |
|
|
|
|
source="$__object/stdin" |
|
|
|
|
fi |
|
|
|
|
destination="${template_dir}/${name}" |
|
|
|
|
require="__directory${template_dir}" \ |
|
|
|
|
__file "$destination" \ |
|
|
|
|
--owner root --group root --mode 640 \ |
|
|
|
|
--source "$source" \ |
|
|
|
|
--state "$state" |
|
|
|
|
# shellcheck disable=SC2030 |
|
|
|
|
export require="__file${destination}" |
|
|
|
|
printf ' source = "%s"\n' "$destination" |
|
|
|
|
|
|
|
|
|
;; |
|
|
|
@ -68,7 +69,7 @@ for param in *; do |
|
|
|
|
esac |
|
|
|
|
done |
|
|
|
|
printf '}\n' |
|
|
|
|
) | \ |
|
|
|
|
} | \ |
|
|
|
|
require="$require __directory${conf_dir}" \ |
|
|
|
|
__config_file "${conf_dir}/${conf_file}" \ |
|
|
|
|
--owner root --group root --mode 640 \ |
|
|
|
|