Issue #19006 has been updated by eric sorenson.
Status changed from Unreviewed to Needs More Information
Assignee set to John Moser
Hi, was there a specific piece of documentation you found which suggested to
use `template("$templatedir/[etc]")` in your manifest? This isn't actually a
top-scope variable, it's a setting, and it's not needed -- the code which
searches for templates will automatically prepend the environment's templatedir
to the relative-path argument to the template function. So if you change your
code to
content => template("percona/loadbalance/haproxy/haproxy.cfg.erb")
it should get found properly.
But in a broader sense (and the Templates guide goes into this) in modern
Puppet, templates live inside modules instead of a stand-alone templatedir, and
are subject to environments there.
We'll update the Learning section on templates to point to the guide, and make
the guide more clear that you just need a relative path.
So two next actions for you:
* Does the relative path cause your template to be found?
* If you can point me at a document that specifically said to use
`$templatedir`, I'll track it down and remove it because it's wrong.
I’ve put this ticket’s status into “Needs more Information” and assigned it to
you. Please either (a) update it with the information I’ve requested and
re-assign it to me if you need more help, or (b) change the status to “Closed”
if you were able to resolve the issue on your own.
----------------------------------------
Bug #19006: per-environment templatedir doesn't actually work,
https://projects.puppetlabs.com/issues/19006#change-83215
Author: John Moser
Status: Needs More Information
Priority: Normal
Assignee: John Moser
Category: server
Target version: 3.x
Affected Puppet version: 3.0.2
Keywords:
Branch:
As per http://docs.puppetlabs.com/guides/environment.html
Puppet will only read the modulepath, manifest, manifestdir, and
templatedir settings from environment config blocks; other settings
in any of these blocks will be ignored in favor of settings in the
[master] or [main] blocks. (Issue 7497)
Issue #7497 covers the above.
What this issue covers is as such:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER:
No such file or directory - /percona/loadbalance/haproxy/haproxy.cfg.erb
With the node having (this is not best practice, but I'll find/write a module
later)
file { '/etc/haproxy/haproxy.cfg':
content =>
template("$templatedir/percona/loadbalance/haproxy/haproxy.cfg.erb"),
owner => 'root',
group => 'root',
mode => '0444',
notify => Service[ 'haproxy' ],
}
And /etc/puppet/puppet.conf on the Puppetmaster containing:
[dmz]
manifestdir = $confdir/environments/$environment/manifests
templatedir = $confdir/environments/$environment/templates
manifest = $confdir/environments/$environment/manifests/site.pp
The documentation indicates that this should work; however, it doesn't.
Using puppetmaster with Passenger here. Apache has been restarted since the
templatedir directive went into the config file.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.