Skip to content

Commit

Permalink
add documentation to the parsing section
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz authored and n00by committed Apr 26, 2018
1 parent 757267f commit 7fd9a11
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions lib/puppet_x/icinga2/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down Expand Up @@ -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'

Expand Down

0 comments on commit 7fd9a11

Please sign in to comment.