Just starting with Puppet and I'm having problems with my first template. It should be very simple, but I can’t understand.
I have a "base" module in
/etc/puppet/modules/base/
./manifests
./manifests/service.pp
./manifests/init.pp
./manifests/params.pp
./manifests/config.pp
./manifests/install.pp
./templates
./templates/puppet.conf.erb
There are other things, but it is not necessary.
base / manifest / init.pp:
class base {
include base::install, base::service, base::config, base::params
}
base / manifests / config.pp
class base::config {
include base::params
File {
require => Class["base::install"],
ensure => present,
owner => root,
group => root,
}
file { "/etc/puppet/puppet.conf":
mode => 0644,
content => template("base/puppet.conf.erb"),
require => Class["base::install"],
nofity => Service["puppet"],
}
...
base / manifest / params.pp
class base::params {
$puppetserver = "pup01.sdirect.lab"
}
Finally, the interesting part of the template in the /templates/puppet.conf.erb database
...
server=<% puppetserver %>
Error message:
err: Failed to parse the template database /puppet.conf.erb: Failed to find the value for 'puppetserver' in /etc/puppet/modules/base/manifests/config.pp:13 in node ...
I do not understand what the problem is. I copied this part directly from the Pro Puppet book.
Can someone show me where $ puppetserver should be defined and how?