diff --git a/cdist/conf/type/__line/gencode-remote b/cdist/conf/type/__line/gencode-remote index 95c2360d..db2a79f8 100755 --- a/cdist/conf/type/__line/gencode-remote +++ b/cdist/conf/type/__line/gencode-remote @@ -38,7 +38,7 @@ if [ -z "$state_is" ]; then echo "touch $file" else # only bark if the file should exists - if [ -f "$__object/parameter/ifexists" ]; then + if [ -f "$__object/parameter/only-if-file-present" ]; then exit 0 fi printf 'The file "%s" is missing. Please create it before using %s on it.\n' "$file" "${__type##*/}" >&2 diff --git a/cdist/conf/type/__line/man.rst b/cdist/conf/type/__line/man.rst index dd41fc40..384f0ed9 100644 --- a/cdist/conf/type/__line/man.rst +++ b/cdist/conf/type/__line/man.rst @@ -31,8 +31,9 @@ file If supplied, use this as the destination file. Otherwise the object_id is used. -ifexists - Only apply the line if the file exists. +only-if-file-present + Only apply the line if the file exists. This can be used to prevent + adding the line to a non-existent file. line Specifies the line which should be absent or present. diff --git a/cdist/conf/type/__line/parameter/boolean b/cdist/conf/type/__line/parameter/boolean new file mode 100644 index 00000000..4aa8d4ef --- /dev/null +++ b/cdist/conf/type/__line/parameter/boolean @@ -0,0 +1,2 @@ +create +only-if-file-present diff --git a/cdist/conf/type/__line/parameter/default/ifexists b/cdist/conf/type/__line/parameter/default/only-if-file-present similarity index 100% rename from cdist/conf/type/__line/parameter/default/ifexists rename to cdist/conf/type/__line/parameter/default/only-if-file-present