projects
/
mirror
/
dsa-puppet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
All our systems are now at least Debian 9
[mirror/dsa-puppet.git]
/
3rdparty
/
modules
/
stdlib
/
lib
/
puppet
/
functions
/
to_yaml.rb
1
# Take a data structure and output it as YAML
2
#
3
# @example how to output YAML
4
# # output yaml to a file
5
# file { '/tmp/my.yaml':
6
# ensure => file,
7
# content => to_yaml($myhash),
8
# }
9
#
10
#
11
require 'yaml'
12
13
Puppet::Functions.create_function(:to_yaml) do
14
dispatch :to_yaml do
15
param 'Any', :data
16
end
17
18
def to_yaml(data)
19
data.to_yaml
20
end
21
end