diff --git a/lib/puppet_x/icinga2/utils.rb b/lib/puppet_x/icinga2/utils.rb index fb37a7b12..e94797b98 100644 --- a/lib/puppet_x/icinga2/utils.rb +++ b/lib/puppet_x/icinga2/utils.rb @@ -101,6 +101,11 @@ def self.attribute_types(attr) def self.parse(row) result = '' + # parser is disabled + if row =~ /^-:(.*)$/ + return $1 + end + # scan function if row =~ /^\{{2}(.+)\}{2}$/ result += "{{%s}}" % [ $1 ] diff --git a/spec/defines/object_spec.rb b/spec/defines/object_spec.rb index 2f61497c0..22afed836 100644 --- a/spec/defines/object_spec.rb +++ b/spec/defines/object_spec.rb @@ -181,6 +181,14 @@ end + context "#{os} with attrs => { vars => { bar => unparsed string } }" do + let(:params) { {:attrs => { 'vars' => { 'bar' => '-:"unparsed string"' } }, :object_type => 'foo', :target => '/bar/baz', :order => '10'} } + + it { is_expected.to contain_concat__fragment('bar') + .with_content(/vars.bar = "unparsed string"/) } + end + + context "#{os} with attrs => { vars => { bar => {} } }" do let(:params) { {:attrs => { 'vars' => { 'bar' => {} } }, :object_type => 'foo', :target => '/bar/baz', :order => '10'} } @@ -447,6 +455,14 @@ end + context "Windows 2012 R2 with attrs => { vars => { bar => unparsed string } }" do + let(:params) { {:attrs => { 'vars' => { 'bar' => '-:"unparsed string"' } }, :object_type => 'foo', :target => 'C:/bar/baz', :order => '10'} } + + it { is_expected.to contain_concat__fragment('bar') + .with_content(/vars.bar = "unparsed string"/) } + end + + context "Windows 2012 R2 with attrs => { vars => { bar => {} } }" do let(:params) { {:attrs => { 'vars' => { 'bar' => {} } }, :object_type => 'foo', :target => 'C:/bar/baz', :order => '10'} }