Skip to content

Instantly share code, notes, and snippets.

@xavpaice
Created May 5, 2014 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xavpaice/55d1503d4f2f7dc17140 to your computer and use it in GitHub Desktop.
Save xavpaice/55d1503d4f2f7dc17140 to your computer and use it in GitHub Desktop.
puppet recursion for directories
xav@xav-lappie:~/tmpdump$ puppet apply test.pp
Notice: Compiled catalog for xav-lappie.orcon in environment production in 0.08 seconds
Error: Cannot create /home/xav/tmpdump/freddie/jane/mary; parent directory /home/xav/tmpdump/freddie/jane does not exist
Error: /Stage[main]//File[/home/xav/tmpdump/freddie/jane/mary]/ensure: change from absent to directory failed: Cannot create /home/xav/tmpdump/freddie/jane/mary; parent directory /home/xav/tmpdump/freddie/jane does not exist
Notice: Finished catalog run in 0.14 seconds
xav@xav-lappie:~/tmpdump$ cat test.pp
file {'/home/xav/tmpdump/freddie/jane/mary':
ensure => directory,
recurse => true,
}
xav@xav-lappie:~/tmpdump$ pwd
/home/xav/tmpdump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment