You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I installed the this module I ran the test script and got the below output:
root@creator ~# 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":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 methodeach' for "10.1.1.100":String
at /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node creator.mgnt.local
While trying to work out what was wrong I realised that in the tests/init.pp file the test for the dhcpd.pool.erb file is passing a string and not an array:
Hi,
When I installed the this module I ran the test script and got the below output:
root@creator ~# 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":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":Stringat /etc/puppet/modules/dhcp/manifests/pool.pp:15 on node creator.mgnt.local
While trying to work out what was wrong I realised that in the tests/init.pp file the test for the dhcpd.pool.erb file is passing a string and not an array:
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',
}
(Look at the range line) which means that in the erb template the string does not have an each method.
Also the DHCP module has a dependency on the Bind Module which means that the test fails because it cannot find the Bind module.
The text was updated successfully, but these errors were encountered: