Peter
2013-Jan-23 22:55 UTC
[Puppet Users] Puppetlabs-dhcp - Failed to parse template dhcp/dhcp.pool.erb, undefined method each
Hi List, After installing the puppetlabs-dhcp module and trying to run the tests/init.pp file I receive and error see below for sequence: puppet module install zleslie/dhcp Notice: Preparing to install into /etc/puppet/modules ... Notice: Downloading from https://forge.puppetlabs.com ... Notice: Installing -- do not interrupt ... /etc/puppet/modules âââ zleslie-dhcp (v1.1.0) (**Needed to install the concat dependacy for the Puppetlabs-dhcp module. Raised a github issue (#17) to include the dependency in the module**) puppet module install ripienaar/concat Notice: Preparing to install into /etc/puppet/modules ... Notice: Downloading from https://forge.puppetlabs.com ... Notice: Installing -- do not interrupt ... /etc/puppet/modules âââ ripienaar-concat (v0.2.0) puppet apply /etc/puppet/modules/dhcp/tests/init.pp --verbose Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb Info: Loading facts in /etc/puppet/modules/concat/lib/facter/concat_basedir.rb Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults Error: Failed to parse template dhcp/dhcpd.pool.erb: Filepath: /etc/puppet/modules/dhcp/templates/dhcpd.pool.erb Line: 7 Detail: undefined method `each'' for "10.1.1.100 10.1.1.200":String at /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node creator.mgnt.local Error: Failed to parse template dhcp/dhcpd.pool.erb: Filepath: /etc/puppet/modules/dhcp/templates/dhcpd.pool.erb Line: 7 Detail: undefined method `each'' for "10.1.1.100 10.1.1.200":String at /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node creator.mgnt.local My question is what could be causing this? I assume that this is something to do with Puppet''s DSL? Thanks, Peter -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/6FOeU4PaEQYJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Peter
2013-Jan-24 11:20 UTC
[Puppet Users] Re: Puppetlabs-dhcp - Failed to parse template dhcp/dhcp.pool.erb, undefined method each
Not sure if it is the reason but making the change seems to fix it. Just incase anyone else comes across this in the future. The init.pp file calling the Pool''s template (https://github.com/puppetlabs/puppetlabs-dhcp/blob/master/tests/init.pp) is passing a string not an array hence the variable not having an each method (see below for extract) dhcp::pool{ ''example.com'': network => ''10.1.1.0'', mask => ''255.255.255.0'', range => *''10.1.1.100 10.1.1.200''*, gateway => ''10.1.1.1'', } By changing the underlined and bolded part to [''10.1.1.100'', ''10.1.1.200''] fixed the error ... go figure. Not sure some ruby setting on my end is not tweaked right or these things get through the test harness? Peter. On Thursday, 24 January 2013 09:55:57 UTC+11, Peter wrote:> > Hi List, > > After installing the puppetlabs-dhcp module and trying to run the > tests/init.pp file I receive and error see below for sequence: > > > puppet module install zleslie/dhcp > Notice: Preparing to install into /etc/puppet/modules ... > Notice: Downloading from https://forge.puppetlabs.com ... > Notice: Installing -- do not interrupt ... > /etc/puppet/modules > âââ zleslie-dhcp (v1.1.0) > > > (**Needed to install the concat dependacy for the Puppetlabs-dhcp module. > Raised a github issue (#17) to include the dependency in the module**) > > puppet module install ripienaar/concat > Notice: Preparing to install into /etc/puppet/modules ... > Notice: Downloading from https://forge.puppetlabs.com ... > Notice: Installing -- do not interrupt ... > /etc/puppet/modules > âââ ripienaar-concat (v0.2.0) > > > > puppet apply /etc/puppet/modules/dhcp/tests/init.pp --verbose > Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb > Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb > Info: Loading facts in > /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb > Info: Loading facts in > /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb > Info: Loading facts in > /etc/puppet/modules/concat/lib/facter/concat_basedir.rb > Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults > Error: Failed to parse template dhcp/dhcpd.pool.erb: > Filepath: /etc/puppet/modules/dhcp/templates/dhcpd.pool.erb > Line: 7 > Detail: undefined method `each'' for "10.1.1.100 10.1.1.200":String > at /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node > creator.mgnt.local > Error: Failed to parse template dhcp/dhcpd.pool.erb: > Filepath: /etc/puppet/modules/dhcp/templates/dhcpd.pool.erb > Line: 7 > Detail: undefined method `each'' for "10.1.1.100 10.1.1.200":String > at /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node > creator.mgnt.local > > > > > > My question is what could be causing this? I assume that this is > something to do with Puppet''s DSL? > > Thanks, > > Peter > > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Pv8LcQm8u9YJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Alex Scoble
2013-Nov-20 20:24 UTC
[Puppet Users] Re: Puppetlabs-dhcp - Failed to parse template dhcp/dhcp.pool.erb, undefined method each
When I change it to an array it injects a comma into the range and DHCP pukes. On Thursday, January 24, 2013 3:20:46 AM UTC-8, Peter wrote:> > Not sure if it is the reason but making the change seems to fix it. Just > incase anyone else comes across this in the future. > > The init.pp file calling the Pool''s template ( > https://github.com/puppetlabs/puppetlabs-dhcp/blob/master/tests/init.pp) > is passing a string not an array hence the variable not having an each > method (see below for extract) > > dhcp::pool{ ''example.com'': > network => ''10.1.1.0'', > mask => ''255.255.255.0'', > range => *''10.1.1.100 10.1.1.200''*, > gateway => ''10.1.1.1'', > } > > > > By changing the underlined and bolded part to [''10.1.1.100'', ''10.1.1.200''] > fixed the error ... go figure. Not sure some ruby setting on my end is not > tweaked right or these things get through the test harness? > > Peter. > > On Thursday, 24 January 2013 09:55:57 UTC+11, Peter wrote: >> >> Hi List, >> >> After installing the puppetlabs-dhcp module and trying to run the >> tests/init.pp file I receive and error see below for sequence: >> >> >> puppet module install zleslie/dhcp >> Notice: Preparing to install into /etc/puppet/modules ... >> Notice: Downloading from https://forge.puppetlabs.com ... >> Notice: Installing -- do not interrupt ... >> /etc/puppet/modules >> âââ zleslie-dhcp (v1.1.0) >> >> >> (**Needed to install the concat dependacy for the Puppetlabs-dhcp module. >> Raised a github issue (#17) to include the dependency in the module**) >> >> puppet module install ripienaar/concat >> Notice: Preparing to install into /etc/puppet/modules ... >> Notice: Downloading from https://forge.puppetlabs.com ... >> Notice: Installing -- do not interrupt ... >> /etc/puppet/modules >> âââ ripienaar-concat (v0.2.0) >> >> >> >> puppet apply /etc/puppet/modules/dhcp/tests/init.pp --verbose >> Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb >> Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb >> Info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb >> Info: Loading facts in >> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb >> Info: Loading facts in >> /etc/puppet/modules/concat/lib/facter/concat_basedir.rb >> Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera >> defaults >> Error: Failed to parse template dhcp/dhcpd.pool.erb: >> Filepath: /etc/puppet/modules/dhcp/templates/dhcpd.pool.erb >> Line: 7 >> Detail: undefined method `each'' for "10.1.1.100 10.1.1.200":String >> at /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node >> creator.mgnt.local >> Error: Failed to parse template dhcp/dhcpd.pool.erb: >> Filepath: /etc/puppet/modules/dhcp/templates/dhcpd.pool.erb >> Line: 7 >> Detail: undefined method `each'' for "10.1.1.100 10.1.1.200":String >> at /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node >> creator.mgnt.local >> >> >> >> >> >> My question is what could be causing this? I assume that this is >> something to do with Puppet''s DSL? >> >> Thanks, >> >> Peter >> >> >> >>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/42592cc9-c180-48e6-976f-f70c705cc3e4%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Alex Scoble
2013-Nov-20 20:27 UTC
[Puppet Users] Re: Puppetlabs-dhcp - Failed to parse template dhcp/dhcp.pool.erb, undefined method each
Nevermind. I think the problem was that I was splitting it up into two members of an array with a comma as opposed to just keeping it one long string. So yeah, this fix worked. Thanks, Alex On Wednesday, November 20, 2013 12:24:03 PM UTC-8, Alex Scoble wrote:> > When I change it to an array it injects a comma into the range and DHCP > pukes. > > On Thursday, January 24, 2013 3:20:46 AM UTC-8, Peter wrote: >> >> Not sure if it is the reason but making the change seems to fix it. Just >> incase anyone else comes across this in the future. >> >> The init.pp file calling the Pool''s template ( >> https://github.com/puppetlabs/puppetlabs-dhcp/blob/master/tests/init.pp) >> is passing a string not an array hence the variable not having an each >> method (see below for extract) >> >> dhcp::pool{ ''example.com'': >> network => ''10.1.1.0'', >> mask => ''255.255.255.0'', >> range => *''10.1.1.100 10.1.1.200''*, >> gateway => ''10.1.1.1'', >> } >> >> >> >> By changing the underlined and bolded part to [''10.1.1.100'', >> ''10.1.1.200''] fixed the error ... go figure. Not sure some ruby setting on >> my end is not tweaked right or these things get through the test harness? >> >> Peter. >> >> On Thursday, 24 January 2013 09:55:57 UTC+11, Peter wrote: >>> >>> Hi List, >>> >>> After installing the puppetlabs-dhcp module and trying to run the >>> tests/init.pp file I receive and error see below for sequence: >>> >>> >>> puppet module install zleslie/dhcp >>> Notice: Preparing to install into /etc/puppet/modules ... >>> Notice: Downloading from https://forge.puppetlabs.com ... >>> Notice: Installing -- do not interrupt ... >>> /etc/puppet/modules >>> âââ zleslie-dhcp (v1.1.0) >>> >>> >>> (**Needed to install the concat dependacy for the Puppetlabs-dhcp >>> module. Raised a github issue (#17) to include the dependency in the >>> module**) >>> >>> puppet module install ripienaar/concat >>> Notice: Preparing to install into /etc/puppet/modules ... >>> Notice: Downloading from https://forge.puppetlabs.com ... >>> Notice: Installing -- do not interrupt ... >>> /etc/puppet/modules >>> âââ ripienaar-concat (v0.2.0) >>> >>> >>> >>> puppet apply /etc/puppet/modules/dhcp/tests/init.pp --verbose >>> Info: Loading facts in >>> /etc/puppet/modules/stdlib/lib/facter/pe_version.rb >>> Info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb >>> Info: Loading facts in >>> /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb >>> Info: Loading facts in >>> /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb >>> Info: Loading facts in >>> /etc/puppet/modules/concat/lib/facter/concat_basedir.rb >>> Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera >>> defaults >>> Error: Failed to parse template dhcp/dhcpd.pool.erb: >>> Filepath: /etc/puppet/modules/dhcp/templates/dhcpd.pool.erb >>> Line: 7 >>> Detail: undefined method `each'' for "10.1.1.100 10.1.1.200":String >>> at /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node >>> creator.mgnt.local >>> Error: Failed to parse template dhcp/dhcpd.pool.erb: >>> Filepath: /etc/puppet/modules/dhcp/templates/dhcpd.pool.erb >>> Line: 7 >>> Detail: undefined method `each'' for "10.1.1.100 10.1.1.200":String >>> at /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node >>> creator.mgnt.local >>> >>> >>> >>> >>> >>> My question is what could be causing this? I assume that this is >>> something to do with Puppet''s DSL? >>> >>> Thanks, >>> >>> Peter >>> >>> >>> >>>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1359ff59-460d-4d1c-8148-998eea162cbd%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.