From: Nicolas Boisselier Date: Sun, 15 Mar 2015 20:50:09 +0000 (+0000) Subject: puppet2yaml X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=9ba56728839335caca8842d6352bdcf0c5117ff8;p=nb.git puppet2yaml --- diff --git a/etc/bashrc.function b/etc/bashrc.function index 02b6c9fc..16457657 100644 --- a/etc/bashrc.function +++ b/etc/bashrc.function @@ -217,6 +217,15 @@ yaml2perl() { perl -MYAML -MData::Dumper -e 'print Dumper YAML::Load(join("",<>))' $@ } +puppet2yaml() { + perl -pe ' +s/\s*=>\s*/: /; +s/,\s*/\n/; +s/^.*\{(.*?:)\s*/$1\n/; +s/\s*\}\s*//; +' +} + nb-rb() { ruby -r/etc/puppet/modules/nb/lib/nb.rb -e "$@" }