diff --git a/conf/type/__file/gencode-local b/conf/type/__file/gencode-local
index a55cfc2b..b74893fb 100755
--- a/conf/type/__file/gencode-local
+++ b/conf/type/__file/gencode-local
@@ -30,6 +30,9 @@ exists="$(cat "$__object/explorer/exists")"
 if [ "$state_should" = "present" ]; then
    if [ -f "$__object/parameter/source" ]; then
       source="$(cat "$__object/parameter/source")"
+      if [ "$source" = "-" ]; then
+         source="$__object/stdin"
+      fi
 
       if [ -f "$source" ]; then
          local_cksum="$(cksum < "$source")"
diff --git a/conf/type/__file/man.text b/conf/type/__file/man.text
index 0215027a..1c61fd51 100644
--- a/conf/type/__file/man.text
+++ b/conf/type/__file/man.text
@@ -39,6 +39,7 @@ owner::
 source::
    If supplied, copy this file from the host running cdist to the target.
    If not supplied, an empty file or directory will be created.
+   If source is '-' (dash), take what was written to stdin as the file content.
 
 
 EXAMPLES
@@ -64,6 +65,12 @@ __file /etc/shadow --source "$__type/files/shadow" \
 __file /home/frodo/.bashrc --source "/etc/skel/.bashrc" \
    --state exists \
    --owner frodo --mode 0600
+
+# Take file content from stdin
+__file /tmp/whatever --owner root --group root --mode 644 --source - << DONE
+Here goes the content for /tmp/whatever
+DONE
+
 --------------------------------------------------------------------------------