Jira (PUP-3966) Short paths for source and template()

1 view
Skip to first unread message

Daniele Sluijters (JIRA)

unread,
Feb 5, 2015, 12:33:18 PM2/5/15
to puppe...@googlegroups.com
Daniele Sluijters created an issue
 
Puppet / New Feature PUP-3966
Short paths for source and template()
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2015/02/05 9:15 AM
Priority: Normal Normal
Reporter: Daniele Sluijters

When writing Puppet modules the file attribute can take either a source or a content, the latter taking a template() call.

In its current state a path passed to source is almost always puppet:///modules/$module_name/path/to/file.ext. This feels ridiculously verbose. Can we make it so that we can use path/to/file instead and have Puppet infer the puppet:///modules/$module_name for us?

The same thing for template:
template("$module_name/path/to/template.erb") could simply be template(template.erb).

The "long" syntax should still be supported if you need to refer to files/templates outside of your own module.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a)
Atlassian logo

Moses Mendoza (JIRA)

unread,
May 15, 2017, 8:06:04 PM5/15/17
to puppe...@googlegroups.com
Moses Mendoza assigned an issue to Henrik Lindberg
Change By: Moses Mendoza
Assignee: Henrik Lindberg
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Sean McDonald (JIRA)

unread,
May 15, 2017, 8:06:05 PM5/15/17
to puppe...@googlegroups.com
Sean McDonald updated an issue
Change By: Sean McDonald
Labels: triaged

Moses Mendoza (JIRA)

unread,
May 15, 2017, 8:07:02 PM5/15/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
May 15, 2017, 8:07:03 PM5/15/17
to puppe...@googlegroups.com

Moses Mendoza (JIRA)

unread,
May 18, 2017, 2:06:27 PM5/18/17
to puppe...@googlegroups.com
Moses Mendoza updated an issue
Change By: Moses Mendoza
Labels: triaged

Henrik Lindberg (JIRA)

unread,
May 19, 2017, 9:35:02 AM5/19/17
to puppe...@googlegroups.com
Henrik Lindberg commented on New Feature PUP-3966
 
Re: Short paths for source and template()

It needs to be backwards compatible. This means we cannot take a relative name to mean something other than what it used to mean.
The functions makes a URI out of the given "path" and interprets "puppet:", then it either accepts an absolute file name or a relative. The relative must start with the a path segment that is the module name.

For the references that are resolved via functions (for example 'template' and 'epp') we could accept a filename $f = "template.erb" (no path separators) to be resolved to the same as if $f = "$module_name/template.erb".

For source it is more complicated as that happens much later when there is no $module_name variable to use.

I could imagine using different URI schemes, a "self:template.erb" could resolve to "this module", a "module::foo::template.erb" to a template in module foo, etc.

Henrik Lindberg (JIRA)

unread,
May 25, 2017, 4:22:02 PM5/25/17
to puppe...@googlegroups.com
Henrik Lindberg assigned an issue to Unassigned
 
Change By: Henrik Lindberg
Assignee: Henrik Lindberg

Josh Cooper (JIRA)

unread,
Jan 22, 2020, 11:05:05 PM1/22/20
to puppe...@googlegroups.com
Josh Cooper commented on New Feature PUP-3966
 
Re: Short paths for source and template()

I agree puppet:///modules/$module_name/path/to/file.ext can be verbose but there hasn't been any movement on this in a while, so I'm closing due to lack of activity.

This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages