1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
define collect($list=[], $order=[]) { file {$name: content => inline_template('<%= order.zip(list).sort {|a,b| a[0] <=> b[0]}.map { |a| a[1].to_s }.join("") %>') } } define snip($content, $path) { Collect <| title == $path |> { list +> $content, order +> $name } } Snip { path => "/tmp/blah" } @collect {"/tmp/blah": } snip { "b": content => "bbbb"; "c": content => "cccc"; "a": content => "aaaa"; } |
