From 7fd9a11c35454a37fd7854f634fecdac81d697d9 Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Sun, 12 Mar 2017 15:15:10 +0100 Subject: [PATCH] add documentation to the parsing section --- README.md | 4 ++++ lib/puppet_x/icinga2/utils.rb | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 0d64d4406..6323b9311 100644 --- a/README.md +++ b/README.md @@ -366,6 +366,10 @@ To generate a valid Icinga 2 configuration all object attributes are parsed. Thi decision for each attribute, whether part of the string is to be quoted or not, and how an array or dictionary is to be formatted. +Parsing of a single attribute can be disabled by tagging it with -: at the front of the string. +``` + attr => '-:"unparsed string with quotes"' +``` An array, a hash or a string can be assigned to an object attribute. True and false are also valid values. Hashes and arrays are created recursively, and all parts – such as single items of an array, keys and its values diff --git a/lib/puppet_x/icinga2/utils.rb b/lib/puppet_x/icinga2/utils.rb index e94797b98..2e1ba7cf6 100644 --- a/lib/puppet_x/icinga2/utils.rb +++ b/lib/puppet_x/icinga2/utils.rb @@ -8,6 +8,11 @@ # simple parsing algorithm takes a decision for each attribute, whether part of the # string is to be quoted or not, and how an array or dictionary is to be formatted. # +# Parsing of a single attribute can be disabled by tagging it with -: at the front +# of the string. +# +# attr => '-:"unparsed string with quotes"' +# # An array, a hash or a string can be assigned to an object attribute. True and false # are also valid values. # @@ -62,6 +67,10 @@ # # attr => 'array1 + [ item1, item2, ... ]' or attr => 'hash1 + { item1, ... }' # +# Assignments other than simple attribution are not currently possible either, e.g. building something like +# +# vars += config +# # require 'puppet'