I have a manifest like this:
class apt {
notice("lsbdistcodename is ${lsbdistcodename}.")
#...
case "${lsbdistid}" {
"Ubuntu": {
package { "ubuntu-keyring": ensure => latest }
}
}
file { "/etc/apt/sources.list":
content => template("apt/${lsbdistcodename}-sources.list.erb"),
tag => preboot,
}
#...
}
When I include that code in a remote node, the puppetmaster reports:
notice: Scope(Class[apt]): lsbdistcodename is .
debug: No true answers and no default
debug: Scope(Class[apt]): Retrieving template apt/-sources.list.erb
/usr/lib/ruby/1.8/puppet/parser/templatewrapper.rb:13:in `initialize'
/usr/lib/ruby/1.8/puppet/parser/functions.rb:215:in `new'
/usr/lib/ruby/1.8/puppet/parser/functions.rb:215:in `function_template'
/usr/lib/ruby/1.8/puppet/parser/functions.rb:211:in `collect'
/usr/lib/ruby/1.8/puppet/parser/functions.rb:211:in `function_template'
/usr/lib/ruby/1.8/puppet/parser/ast/function.rb:14:in `send'
/usr/lib/ruby/1.8/puppet/parser/ast/function.rb:14:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/resourceparam.rb:16:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/resource.rb:15:in `evaluate'
/usr/lib/ruby/1.8/erb.rb:739:in `collect'
/usr/lib/ruby/1.8/puppet/parser/ast/branch.rb:16:in `each'
/usr/lib/ruby/1.8/puppet/parser/ast/branch.rb:15:in `each'
/usr/lib/ruby/1.8/puppet/parser/ast/resource.rb:14:in `collect'
/usr/lib/ruby/1.8/puppet/parser/ast/resource.rb:14:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:35:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:34:in `collect'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:34:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/hostclass.rb:74:in `evaluate_code'
/usr/lib/ruby/1.8/puppet/parser/resource.rb:61:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:145:in `evaluate_classes'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:136:in `each'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:136:in `evaluate_classes'
/usr/lib/ruby/1.8/puppet/parser/functions.rb:114:in `function_include'
/usr/lib/ruby/1.8/puppet/parser/ast/function.rb:14:in `send'
/usr/lib/ruby/1.8/puppet/parser/ast/function.rb:14:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:35:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:34:in `collect'
/usr/lib/ruby/1.8/puppet/parser/ast/astarray.rb:34:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/ast.rb:54:in `safeevaluate'
/usr/lib/ruby/1.8/puppet/parser/ast/hostclass.rb:74:in `evaluate_code'
/usr/lib/ruby/1.8/puppet/parser/ast/hostclass.rb:51:in `evaluate_code'
/usr/lib/ruby/1.8/puppet/parser/resource.rb:61:in `evaluate'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:238:in `evaluate_ast_node'
/usr/lib/ruby/1.8/puppet/parser/compiler.rb:88:in `compile'
/usr/lib/ruby/1.8/puppet/parser/interpreter.rb:29:in `compile'
/usr/lib/ruby/1.8/puppet/network/handler/configuration.rb:107:in `compile'
/usr/lib/ruby/1.8/puppet/util.rb:217:in `benchmark'
/usr/lib/ruby/1.8/puppet/network/handler/configuration.rb:105:in `compile'
/usr/lib/ruby/1.8/puppet/network/handler/configuration.rb:40:in `configuration'
/usr/lib/ruby/1.8/puppet/network/handler/master.rb:69:in `getconfig'
/usr/lib/ruby/1.8/puppet/util.rb:212:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/1.8/puppet/util.rb:211:in `benchmark'
/usr/lib/ruby/1.8/puppet/network/handler/master.rb:68:in `getconfig'
/usr/share/rails/activerecord/lib/../../activesupport/lib/active_support/inflector.rb:250:in `to_proc'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in `call'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in `protect_service'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:85:in `setup_processor'
/usr/lib/ruby/1.8/xmlrpc/server.rb:336:in `call'
/usr/lib/ruby/1.8/xmlrpc/server.rb:336:in `dispatch'
/usr/lib/ruby/1.8/xmlrpc/server.rb:323:in `each'
/usr/lib/ruby/1.8/xmlrpc/server.rb:323:in `dispatch'
/usr/lib/ruby/1.8/xmlrpc/server.rb:366:in `call_method'
/usr/lib/ruby/1.8/xmlrpc/server.rb:378:in `handle'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:44:in `process'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/webrick_servlet.rb:68:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/1.8/puppet.rb:336:in `start'
/usr/lib/ruby/1.8/puppet.rb:187:in `newthread'
/usr/lib/ruby/1.8/puppet.rb:186:in `initialize'
/usr/lib/ruby/1.8/puppet.rb:186:in `new'
/usr/lib/ruby/1.8/puppet.rb:186:in `newthread'
/usr/lib/ruby/1.8/puppet.rb:334:in `start'
/usr/lib/ruby/1.8/puppet.rb:333:in `each'
/usr/lib/ruby/1.8/puppet.rb:333:in `start'
/usr/sbin/puppetmasterd:281
/usr/lib/ruby/1.8/puppet/parser/interpreter.rb:32:in `compile'
/usr/lib/ruby/1.8/puppet/network/handler/configuration.rb:107:in `compile'
/usr/lib/ruby/1.8/puppet/util.rb:217:in `benchmark'
/usr/lib/ruby/1.8/puppet/network/handler/configuration.rb:105:in `compile'
/usr/lib/ruby/1.8/puppet/network/handler/configuration.rb:40:in `configuration'
/usr/lib/ruby/1.8/puppet/network/handler/master.rb:69:in `getconfig'
/usr/lib/ruby/1.8/puppet/util.rb:212:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/1.8/puppet/util.rb:211:in `benchmark'
/usr/lib/ruby/1.8/puppet/network/handler/master.rb:68:in `getconfig'
/usr/share/rails/activerecord/lib/../../activesupport/lib/active_support/inflector.rb:250:in `to_proc'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in `call'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:52:in `protect_service'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:85:in `setup_processor'
/usr/lib/ruby/1.8/xmlrpc/server.rb:336:in `call'
/usr/lib/ruby/1.8/xmlrpc/server.rb:336:in `dispatch'
/usr/lib/ruby/1.8/xmlrpc/server.rb:323:in `each'
/usr/lib/ruby/1.8/xmlrpc/server.rb:323:in `dispatch'
/usr/lib/ruby/1.8/xmlrpc/server.rb:366:in `call_method'
/usr/lib/ruby/1.8/xmlrpc/server.rb:378:in `handle'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/processor.rb:44:in `process'
/usr/lib/ruby/1.8/puppet/network/xmlrpc/webrick_servlet.rb:68:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/1.8/puppet.rb:336:in `start'
/usr/lib/ruby/1.8/puppet.rb:187:in `newthread'
/usr/lib/ruby/1.8/puppet.rb:186:in `initialize'
/usr/lib/ruby/1.8/puppet.rb:186:in `new'
/usr/lib/ruby/1.8/puppet.rb:186:in `newthread'
/usr/lib/ruby/1.8/puppet.rb:334:in `start'
/usr/lib/ruby/1.8/puppet.rb:333:in `each'
/usr/lib/ruby/1.8/puppet.rb:333:in `start'
/usr/sbin/puppetmasterd:281
err: Could not find template apt/-sources.list.erb at /etc/puppet/modules/apt/manifests/init.pp:23 on node node.mycorp.com
Facter, run on that node, does know about the lsbdistcodename fact:
$ facter | grep lsb
lsbdistcodename => gutsy
lsbdistdescription => Ubuntu 7.10
lsbdistid => Ubuntu
lsbdistrelease => 7.10
The fact is also set correctly in the :configuration section of state.yaml on the client, as well as in the yaml/facts/node.mycorp.com.yaml file on the server.
I've tried completely fresh installs on the server, including blowing away the full /var/lib/puppet dir and the mysql database, but to no success. The server version is 0.24.3, and the problem exhibits itself on nodes running version 0.24.1 and 0.24.3; all the servers are ubuntu gutsy, and the puppet installs are those from packages.debian.org.
Possibly relevant is the fact that I also got bit by #1137; see that ticket for the patch I used to get around that problem.