From 9ba56728839335caca8842d6352bdcf0c5117ff8 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sun, 15 Mar 2015 20:50:09 +0000 Subject: [PATCH] puppet2yaml --- etc/bashrc.function | 9 +++++++++ 1 file changed, 9 insertions(+) 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 "$@" } -- 2.47.3